-
Notifications
You must be signed in to change notification settings - Fork 54
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/372 data layout #423
Merged
Merged
Changes from 34 commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
93a8ccc
Added dndarray property 'stride' (same as torch.Tensor.stride).
ClaudiaComito 6df3bed
Merge branch 'master' into features/372-data_layout
ClaudiaComito c2faa47
Implemented tensor property strides (numpy-like), added to docs.
ClaudiaComito 8cb873c
Merge branch 'master' into features/372-data_layout
ClaudiaComito 7c12fe5
First pass of column-first memory layout, single-node only.
ClaudiaComito b01511b
Implemented stride_tricks.sanitize_memory_layout, first pass.
ClaudiaComito d01d14d
Property DNDarray.strides now gets the correct information from the u…
ClaudiaComito 5b6276d
Moved sanitize_memory_layout from stride_tricks to module memory.
ClaudiaComito 2d0596d
Implemented memory.sanitize_memory_layout.
ClaudiaComito 5ace9e1
Introduced attribute order in factories.array, enables specification …
ClaudiaComito 89caeaa
sanitize_memory_layout(), moved tests for least likely occurrencies t…
ClaudiaComito bfaec9c
Fixed typos.
ClaudiaComito d619ce6
Merge branch 'master' into features/372-data_layout
ClaudiaComito a60482f
ht.array, docs and examples for attribute "order" defining memory lay…
ClaudiaComito dba61a2
Expanded documentation to sanitize_memory_layout().
ClaudiaComito 90b6e16
Keyword argument order introduced for all factories (except those cre…
ClaudiaComito 12934d1
Typo.
ClaudiaComito c442fa8
Implemented function assertTrue_memory_layout()
ClaudiaComito 1da8a74
Modified sanitize_memory_layout() to address tensors with unknown/wro…
ClaudiaComito bb9a2b6
sanitize_memory_layout(), removed unnecessary checks (ndim < 2 and st…
ClaudiaComito c62974b
Added keyword argument order in factories calls.
ClaudiaComito e18eee6
First draft of function test_sanitize_memory_layout()
ClaudiaComito c725a8b
Modified row_major, column_major condition to allow for shape=1 along…
ClaudiaComito 76a1617
Added memory layout test for 5D tensor, non distributed, shape contai…
ClaudiaComito 5628fac
Added memory layout test for non distributed tensor after reduction o…
ClaudiaComito 932a85e
Removed test for non distributed tensor after reduction operation, no…
ClaudiaComito c3ede72
Implemented tests for sanitize_memory_layout()
ClaudiaComito 5beea49
In assert_array_equal(), Allreduce running on self._comm, not on self…
ClaudiaComito 43df1ab
Removing unused variable.
ClaudiaComito e47ac20
Fixed error that messed up column-major memory layout for ndim>3
ClaudiaComito 3a096ad
Fixed and expanded tests for sanitize_memory_layout
ClaudiaComito 814caa9
Fixed wrong variable reference after pre-commit
ClaudiaComito b659576
pre-commit changes
ClaudiaComito eea901b
Improved docs.
ClaudiaComito c38dede
Extending BasicTest in TestMemory
ClaudiaComito eca64fa
Merge branch 'master' into features/372-data_layout
coquelin77 e7d0090
Re-adding assertTrue_memory_layout to BasicTest
ClaudiaComito 3bb13ba
Function test_dndarray.test_stride_and_strides(), first pass,
ClaudiaComito 218345b
Added float32, row-major and float64, column-major stride tests
ClaudiaComito d3a7499
test_stride_and_strides: Added test cases for distributed tensors in …
ClaudiaComito ae00b59
pre-commit reformatting
ClaudiaComito fbe9738
Added function test_basic_test.test_assertTrue_memory_layout()
ClaudiaComito c21d6be
Merge branch 'master' into features/372-data_layout
ClaudiaComito 38802e8
dndrray.strides, replaced np.array(...)*itemsize with list comprehens…
ClaudiaComito 46fbc2e
pre-commit minor changes
ClaudiaComito File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use torch here instead of numpy? numpy doesnt like GPUs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is even no need to return a array (Numpy or PyTorch) at all as stride() already returns a tuple
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@krajsek this is the numpy-like version of stride (output in bytes), I need to be able to multiply it by the element size.
@coquelin77 if you expect problems I'll use list comprehension instead of numpy. Must we be wary of every numpy call then, or only when dealing with large arrays?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we should always be wary of using numpy. we should aim to use primarily pytorch functions. Also, if i dont misunderstand, wrapping this in a numpy array doesnt really get us anything since its already a torch tensor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Daniel.
This:
self._DNDarray__array.stride()
is a tuple. In order to provide numpy-like information (output in bytes), this tuple has to be multiplied by the element size of the tensor (scalar, bytes). I need to change the tuple into something that can be multiplied by a scalar. I'll use list comprehension and be done with it.