Skip to content
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

Features/types #42

Merged
merged 17 commits into from
Aug 2, 2018
Merged

Features/types #42

merged 17 commits into from
Aug 2, 2018

Conversation

Markus-Goetz
Copy link
Member

Realized HeAT's type system. Enabled type casting. Major refactoring of existing code to utilize new type system.

Resolves issues #10 and #12

Detailed overview of the changes:

  • setup.py requires torch and numpy, h5py is optional dependency
  • added io module
    • contains optional hdf5 loading function
    • enhanced hdf5 loading function to support arbitrary dimensions
    • added documentation
    • added tests
  • added random module
    • copy over of the existing global seed initialization and uniform sampling
    • test cases and documentation missing
  • enhanced communicator module
    • introduced abstract Communicator base class
    • communicators must now always be instantiated for a tensor
    • each communicator now has a chunk method, i.e. dividing a shape into slices according to the communication strategy and split axis, previously part of the load_h5 method
    • added tests
    • added documentation
  • removed float16/half type, only rudimentary CPU support from PyTorch
  • core module pulls io unqualified, random qualified, tensor qualified through to the parent module
  • enhanced tensor module
    • introduced new constructor method
    • refactored existing code to utilize existing constructor
    • added a number of TODOs for missing documentation, tests, functionality, ...
    • added tested and documented astype cast function (see issue Implement type casts #10)
  • refactored kmeans code
    • now utilizes the refactored random and tensor modules
    • refactored tests cases to utilize Python's unittest, need to be enhanced to better check KMeans functionality
    • added TODOs for missing documentation and functionality

* Implements subset of numpy's type system (see numpy/core/numerictypes.py) that is also supported by PyTorch's type system
* List of supported types
    - bool
    - int8
    - int16
    - int32
    - int64
    - uint8
    - float16
    - float32
    - float64
* Currently untested
* Contribution to issue #12
* Setup requires torch to be installed
* Exposed types to the core module via unqualified import in core module
* Turned the core tests directory into a module (i.e. __init__.py added)
* Created first test cases for non instantiable types
…of existing code to utilize new type system.

Resolves issues #10 and #12

Detailed overview of the changes:

* setup.py requires torch and numpy, h5py is optional dependency
* added io module
    - contains optional hdf5 loading function
    - enhanced hdf5 loading function to support arbitrary dimensions
    - added documentation
    - added tests
* added random module
    - copy over of the existing global seed initialization and uniform sampling
    - test cases and documentation missing
* enhanced communicator module
    - introduced abstract Communicator base class
    - communicators must now always be instantiated for a tensor
    - each communicator now has a chunk method, i.e. dividing a shape into slices according to the communication strategy and split axis, previously part of the load_h5 method
    - added tests
    - added documentation
* removed float16/half type, only rudimentary CPU support from PyTorch
* core module pulls io unqualified, random qualified, tensor qualified through to the parent module
* enhanced tensor module
    - introduced new constructor method
    - refactored existing code to utilize existing constructor
    - added a number of TODOs for missing documentation, tests, functionality, ...
    - added tested and documented astype cast function (see issue #10)
* refactored kmeans code
    - now utilizes the refactored random and tensor modules
    - refactored tests cases to utilize Python's unittest, need to be enhanced to better check KMeans functionality
    - added TODOs for missing documentation and functionality
* Communicator still exposes only 'mpi', commented the reason
* Replaced abstractclassmethod decorator with abstractmethod decorator
* Renamed complex value to elaborate value in type tests
* Modified k-means test to depend on k, not a literal
* Modified setup.py to use the proper extras_require call
* Removed requirements.txt, dependencies should be in the setup.py only for pip packages
* Modificiations to setup.py
    - Added tentative version requirements for dependencies
    - HDF5 is an optional feature and is treated as such, see extras_require
* Modifications to Travis
    - Now also installs libhdf5
    - Installs our package via pip only (no requirements.txt), with all extra features
    - Unittests are now executed on the top level via the unittest module
* Reintroduced @abc.abstractclassmethod for torch_types due to failing tests
@Markus-Goetz Markus-Goetz self-assigned this Aug 1, 2018
@Markus-Goetz Markus-Goetz added this to the Foundation milestone Aug 1, 2018
Copy link
Member

@d1saster d1saster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, ship it!

@rainman110 rainman110 merged commit 16acb5f into master Aug 2, 2018
@Markus-Goetz Markus-Goetz deleted the features/types branch August 30, 2018 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants