Skip to content

Commit

Permalink
Setup 438 (facebookresearch#441)
Browse files Browse the repository at this point in the history
Summary:
## Types of changes

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [x] Docs change / refactoring / dependency upgrade

## Motivation and Context / Related issue

This is a small change that has three targets (in order of importance):
* Re-enable two tests that were disabled in an earlier diff.
* Setup using the command "python3 setup.py install --user" (see facebookresearch#438) does not work. While users can still use "pip3 install -e ." to install crypten. The small change to enable that alternate mode of installation will not break pip3 installation.
* Remove some commented-out text.

## How Has This Been Tested (if it applies)

Tested the installation using the two methods mentioned above.
For other tests, relying on CI.

## Checklist

- [x] The documentation is up-to-date with the changes I made.
- [x] I have read the **CONTRIBUTING** document and completed the CLA (see **CONTRIBUTING**).
- [x] All tests passed, and additional code has been covered with new tests.

Pull Request resolved: facebookresearch#441

Test Plan: All tests in circleci on github have passed.

Reviewed By: ashkan-software

Differential Revision: D41842233

Pulled By: mohammad-alrubaie

fbshipit-source-id: 74fca47b624d525ce730316e458f3ec1de080a30
  • Loading branch information
mohammad-alrubaie authored and facebook-github-bot committed Dec 8, 2022
1 parent 891fa47 commit 909df45
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
no_output_timeout: 3h
command: |
. ~/crypten-test/bin/activate
echo 'for i in $(ls test/test_*.py | grep -Ev "test_(context|benchmark|tensorboard|models|cuda)"); do python3 -m unittest $i; (($? != 0)) && exit 1; done; exit 0' > run_tests.sh
echo 'for i in $(ls test/test_*.py | grep -Ev "test_(context|benchmark|models)"); do python3 -m unittest $i; (($? != 0)) && exit 1; done; exit 0' > run_tests.sh
bash ./run_tests.sh
- run:
name: Linear svm example
Expand Down
8 changes: 4 additions & 4 deletions crypten/common/serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ class RestrictedUnpickler(pickle.Unpickler):
"torch.ByteStorage",
"torch.DoubleStorage",
"torch.FloatStorage",
# "torch._C.HalfStorageBase",
# "torch._C.QInt32StorageBase",
# "torch._C.QInt8StorageBase",
# "torch.storage._TypedStorage",
"torch._C.HalfStorageBase",
"torch._C.QInt32StorageBase",
"torch._C.QInt8StorageBase",
"torch.storage._TypedStorage",
]

for item in __ALLOWLIST:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@
author=AUTHOR,
license=LICENSE,
tests_require=["pytest"],
data_files=[("/configs", ["configs/default.yaml"])],
data_files=[("configs", ["configs/default.yaml"])],
)
1 change: 0 additions & 1 deletion test/test_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def test_correctness_validation(self):
encrypted_tensor.add(10)

# Ensure incorrect validation works properly for value
# tensor2 = get_random_test_tensor(size=(2, 2), is_float=True)
encrypted_tensor.add = lambda y: crypten.cryptensor(tensor)
with self.assertRaises(ValueError):
encrypted_tensor.add(10)
Expand Down
1 change: 0 additions & 1 deletion test/test_gradients.py
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,6 @@ def tearDown(self):
super(TestTFP, self).tearDown()


# @unittest.skip("Almost all TTP tests are timing out")
class TestTTP(MultiProcessTestCase, TestGradients):
def setUp(self):
self._original_provider = cfg.mpc.provider
Expand Down

0 comments on commit 909df45

Please sign in to comment.