Implement ceil Functionality in FloatTensor with CPU/GPU Backend Support
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:
- For a reference on the operation this performs check out PyTorch's documentation.
- For a reference on how to program in Unity, check out this basic tutorial
- For a reference on how to write HLSL code, check out this basic tutorial
- For a complete tutorial on how to add functions to FloatTensor (step by step guide) see this Google Document
- For a reference on how other functions like this have been implemented check out the functions in this notebook as well as the corresponding files that made it possible (SyftController, FloatTensor.Ops, FloatTensor.ShaderOps, FloatTensorShaders, and FloatTensorTest).
- And of course, please consider our Contributor Guidelines for all contributions.
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.
Working on this while taking a break from Thanksgiving family time :)
#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.
And this also maps to the OpenMined pull request #59
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
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!
Dude - you're the man
@abe732 How's your progress on this issue so far? Have you found any blocks on the road?
@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
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
Hi @abe732! Can you confirm that we have functionality for CPU, GPU with unit (both CPU and GPU) and integration tests?
Yep double checked on everything and it's all there & working!