Skip to content
This repository was archived by the owner on Nov 7, 2024. It is now read-only.

Block sparse merged #452

Merged
merged 209 commits into from
Jan 29, 2020

Conversation

mganahl
Copy link
Contributor

@mganahl mganahl commented Jan 29, 2020

cleaned up code

mganahl and others added 26 commits January 20, 2020 15:40
* added test for mps switch backend

* added switch backend method to MPS

* added test for network operations switch backend

* make sure switch_backend not only fixes tensor but also node property

* added switch_backend to init

* added missing tests for network operations

* some linting issues
concat function
* rename from cocate to shape_concat

shape function
* rename from shape to shape_tensor

prod function
* rename from prod to shape_prod
* function name is duplicated in shell_backend.py
* rename existing shape_prod function to shape_product
* need to change the name later

Co-authored-by: Chase Roberts <keeper6928@gmail.com>
* Add files via upload

Added SAT Tutorials

* Update SATTutorial.ipynb

* Update SATTutorial.ipynb

* Update SATTutorial.ipynb

* Update SATTutorial.ipynb

* License changed

* Created using Colaboratory

Co-authored-by: Chase Roberts <chaseriley@google.com>
* added test for mps switch backend

* added switch backend method to MPS

* added test for network operations switch backend

* make sure switch_backend not only fixes tensor but also node property

* added switch_backend to init

* added a lot of tests for network components

* a lot more tests

* some more tests

* some linter things

* added test base class instead of hack

* disabled some pytype warnings

* disabled some pylint warnings
…_envs (google#440)

* Return empty dict for empty input to MPS envs

* Add tests for empty sequence input to MPS envs

* Use explicit sequences for MPS envs tests

Co-authored-by: Chase Roberts <chaseriley@google.com>
* A context manager support implementation for setting up a backend for Nodes. (Issue google#339)

* Stack-based backend context manager implementation

* code styele fix

* Added get_default_backend() function which returns top stack backend.
  Stack returns config.default_backend if there is nothing in stack.

A little clean-up in test file.

* - Moved `set_default_backend` to the `backend_contextmanager`
- `default_backend` now is a property of `_DefaultBackendStack`
- removed `config` imports as an unused file.
- fixed some tests in `backend_contextmanager_test.py`

* little code-style fix

Co-authored-by: Chase Roberts <chaseriley@google.com>
…de class (google#439)

* BaseNode / Edge class text input protection added (google#423)

BaseNode class - Add protection to name, axis_names
*Protected in 3 place
*Initialize stage - __init__
*Function use setting - set_name / add_axis_names
*Property - Add @Property to name to protect direct adding node.name = 123

Edge class - Add protection to name
*Protected in 3 place
*Initialize stage - __init__
*Function use setting - set_name
*Property

* BaseNode / Edge class text input protection code revise (google#423)

*if type(name) != str
*if not isinstance(name, str)
*change using type to isinstance to follow pylint

* Algebraic operation add( + ), sub( - ), mul( * ), div( / ) for BaseNode class (google#292)

        *[BaseNode class] - add / sub / mul / truediv NotImplemented function Added
        *[Node class] - add / sub / mul / truediv function added
        *[CopyNode class] - overload the BaseNode mul / truediv as NotImplemented

        *[basebackend] - add / sub / mul / div NotImplemented function added
        *[numpy / tensorflow / pytorch] - add / sub / mul / div function added
        *[shell] - add / sub / div NotImplemented function added

        *Testing files
        [network_components_free_test]
        * Exception - Tensorflow is not tested when the operand is scalar
        * 1. Check add / sub / mul / div with int / float / Node
        * 2. Check implicit conversion
        * 2. Check the Type Error when type is not int / float / Node
        * 3. Check is the operand backend same
        * 4. Check is BaseNode has attribute _tensor

        [backend_test - numpy / tensorflow / pytorch]
        *check add / sub / mul / divide work for int / float / Node

* Add test cases for Tensorflow Algebraic operation and fix add, sub name (google#292)

[Change name]
*add -> addition
*subtract -> substraction

[Add test case for Tensorflow]
* Specify the datatype to resolve the conflict between different dtype operation

[Test case for pytorch / jax]
* pytorch - [int / int -> int] give different answer for torch when it is dividing two integer
* jax - Different from other backend jax backend return 64bits dtype even operate between 32bits
        so put exceptional dtype test case for jax backend

* Add test cases for Tensorflow Algebraic operation and fix add, sub name (google#292)

[Change name]
*add -> addition
*subtract -> substraction

[Add test case for Tensorflow]
* Specify the datatype to resolve the conflict between different dtype operation

[Test case for pytorch / jax]
* pytorch - [int / int -> int] give different answer for torch when it is dividing two integer
* jax - Different from other backend jax backend return 64bits dtype even operate between 32bits
        so put exceptional dtype test case for jax backend

* Add __add__, __sub__, __mul__, __truediv__ to TestNode Class

Co-authored-by: Chase Roberts <chaseriley@google.com>
* None checks added for constructors

* Changes in None check and resolve comments
* added test for mps switch backend

* added switch backend method to MPS

* added test for network operations switch backend

* make sure switch_backend not only fixes tensor but also node property

* added switch_backend to init

* missing test for backend contextmanager

* notimplemented tests for base backend

* added subtraction test notimplemented

* added jax backend index_update test

* first missing tests for numpy

* actually catched an error in numpy_backend eigs method!

* more eigs tests

* didnt catch an error, unexpected convention

* more tests for eigsh_lancszos

* added missing pytorch backend tests

* added missing tf backend tests

* pytype

* suppress pytype

Co-authored-by: Chase Roberts <chaseriley@google.com>
@mganahl mganahl merged commit f09e871 into google:experimental_blocksparse Jan 29, 2020
@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@mganahl
Copy link
Contributor Author

mganahl commented Jan 29, 2020

shoot, I think this is because I fetched the upstream/master and merged it locally into my branch prior to submitting the PR ...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.