PySyft icon indicating copy to clipboard operation
PySyft copied to clipboard

Implement ceil Functionality in FloatTensor with CPU/GPU Backend Support

Open iamtrask opened this issue 9 years ago • 11 comments

User Story: As a Data Scientist using PySyft's FloatTensor type, I want to leverage a wide range of methods which use our new Unity backend. For this ticket to be complete, the ceil() should be added to our FloatTensor class with the appropriate functionality, returning a new tensor.

Furthermore, the function should automatically determine which backend to use (CPU/GPU) based on where the data is located. If the data is located on the CPU, a performant CPU implementation should run but if the data for a given FloatTensor is located on a GPU, it should be run using an HLSL kernel where appropriate. Obviously, if no GPU is available, it should automatically fall back to the CPU implementation.

Every Reference You Might Need for this Issue:

Acceptance Criteria:

  • [ ] an integration test in PySyft demonstrating the correct CPU and GPU operation implemented over a FloatTensor while connected to a Unity backend
  • [ ] a Unit Test in OpenMined/OpenMined demonstrating the correct operation on a FloatTensor
  • [ ] inline documentation in the python code. For inspiration on inline documentation, please check out PyTorch's documentation for this operator.
  • [ ] Link your Pull Request back to this Issue so that it gets closed appropriately when the PR is merged.

iamtrask avatar Nov 23 '17 15:11 iamtrask

Working on this while taking a break from Thanksgiving family time :)

abe732 avatar Nov 23 '17 20:11 abe732

#631 wasn't sure where to add an integration test, but all other requirements I think should be met. Let me know--happy to revise as needed.

abe732 avatar Nov 24 '17 00:11 abe732

And this also maps to the OpenMined pull request #59

abe732 avatar Nov 24 '17 00:11 abe732

Man that was fast! - Code is looking great. Only had one question which I linked to the PR. With regard to Integration tests - we don't yet have a framework for it. I'll need to get back to you on that. For Unit Tests, these are the droids you're looking for - https://github.com/OpenMined/OpenMined/blob/master/Assets/OpenMined.Tests/Editor/FloatTensorTest.cs

iamtrask avatar Nov 24 '17 09:11 iamtrask

Okay great 👍. Was able to figure out the unit test no problem. Will crank through a bunch of these functions once this first one clears-- want to make sure the basic implementation and test coverage is what you're looking for beforehand!

abe732 avatar Nov 24 '17 19:11 abe732

Dude - you're the man

iamtrask avatar Nov 24 '17 19:11 iamtrask

@abe732 How's your progress on this issue so far? Have you found any blocks on the road?

diegoalejogm avatar Nov 29 '17 22:11 diegoalejogm

@diegoalejogm didn't see you're comment. I think the integration test is still missing (which from the slack, looks like there might be a system I could follow now for writing those?). Been in a bit of a cave w/ finals, but wrapping up here in the next 2-3 days and can switch back to this

abe732 avatar Dec 12 '17 17:12 abe732

Took a look back through, and the pull requests went through, so the issue is good to close. Was before we had integration tests, which this opened up that as a new issue which has been resolved too

abe732 avatar Dec 13 '17 05:12 abe732

Hi @abe732! Can you confirm that we have functionality for CPU, GPU with unit (both CPU and GPU) and integration tests?

diegoalejogm avatar Dec 14 '17 04:12 diegoalejogm

Yep double checked on everything and it's all there & working!

abe732 avatar Dec 22 '17 22:12 abe732