-
Notifications
You must be signed in to change notification settings - Fork 59
Implementation of proposed syntax changes #768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Develop: fixes for test_environments
@tclose - at this point, does it make sense to still keep two separate areas (design/engine) in the codebase? or simply merge them? i think we are all in agreement that this new design is the path we want to take. |
Thanks :) although my plan was to keep the design area separate in the final state. Actually, in the refactor I had in mind I was planning to pull out environments and workers into separate namespaces, e.g. I also wanted to pull out the helper functions into |
…ere being included
Develop: Test specs
…s it is no longer necessary
Test_submitter
Ok, I believe this is all good to go!! I have added a brief glossary to the docs explaining some of the new concepts and a few of the attributes I renamed (see docs/source/reference/glossary.rst). Let me know if there is anything else, otherwise it would be great to get this merged and a 1.0a released so I can start updating the rest of my packages to point to that 😁 |
thanks tom. i will leave it to you and others to pull the trigger. regarding prereleases and auto (which we use), we may need to setup a few things: https://intuit.github.io/auto/docs/generated/next (may not be a bad thing to setup). alternatively, we could merge into |
one last question is the hashing of arbitrary objects, especially given the issues we had with torch arrays. is there a default serializer that should handle any arbitrary object? it did seem from that issue that we had to write and register our own serializer, and that the default backstop was not sufficient. (see: https://github.com/sensein/senselab/blob/5f1af5b5305579c8bdd698837dc8048d5284229d/src/senselab/utils/data_structures/pydra_helpers.py#L17). |
The backstop object bytes-repr is here Lines 308 to 346 in bc6b0a9
I did make some changes to it so that it can handle slots classes (as well as special handling for attrs-generated objects), so would be interested if it can now handle the PyTorch arrays. If not, I might be worth adding those bytes-repr functions to the hash module with guards for the case where torch is not installed |
perhaps i'm doing something wrong, but let me know if this makes sense to you. it doesn't seem to be reflecting the object fully, i.e. the output doesn't change for the two different tensors. In [15]: a = torch.tensor([1, 2])
In [16]: list(bytes_repr(a, cache=cache))
Out[16]: [b'torch.Tensor:{', b'}']
In [17]: a = torch.tensor([3, 4])
In [18]: list(bytes_repr(a, cache=cache))
Out[18]: [b'torch.Tensor:{', b'}'] for a backstop i was hoping it would be similar to the cloudpickle/pickle option, where as long as it is pickleable we can potentially hash it. |
I had a look at the shipit pre-release docs, and I think that would work better > 1.0, as we don't really want to keep the current master as the default until 1.0 is released. So if you guys are ok with it, I will pull the trigger on the merge and manually release a 1.0a. I'm also happy to rename the |
whereas the In [21]: a = np.array([3, 4])
In [22]: list(bytes_repr(a, cache=cache))
Out[22]:
[b'numpyndarray:2:',
b'\x03\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00']
In [23]: a = np.array([1, 2])
In [24]: list(bytes_repr(a, cache=cache))
Out[24]:
[b'numpyndarray:2:',
b'\x01\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00'] |
Interesting, Cloudpickle would be guaranteed to be unique, but it is not guaranteed to produce the same representations between equivalent objects so you would get a lot of false-negative cache lookups, e.g.
|
Maybe this could be addressed in a separate PR though... |
thanks for the cloudpickle example - fine with addressing this in a separate PR. |
woohoo! |
Types of changes
Summary
Implements proposed syntax changes in #692
Test modules (to fix)
Checklist