Skip to content

Refactor sync#48

Open
alexandermorozov wants to merge 4 commits intoautumnai:masterfrom
alexandermorozov:refactor-sync
Open

Refactor sync#48
alexandermorozov wants to merge 4 commits intoautumnai:masterfrom
alexandermorozov:refactor-sync

Conversation

@alexandermorozov
Copy link

This PR implements support for better sync API: autumnai/collenchyma#37, autumnai/collenchyma#62. Scope is a bit wider, actually, since I've also refactored tests, they are 5-10 times shorter now without any drawbacks.

It's WiP, there are still unconverted tests. I think it'll take a few more days.

Refactor code CUDA and Native backend to match #autumnai/collenchyma/62 that
provides enchanced memory management and syncronization. Since memory
management is now automatic, `*_plain` variants of functions are removed.

BREAKING CHANGE: *_plain versions of API functions are removed, arguments of
their counterpart functions may have changed in mutablity.

REFERENCE: autumnai/collenchyma#37, autumnai/collenchyma#62
Refactor tests to be generic on backend and element type, use generic
functions to fill input vectors and check outputs. Use macros to instantiate
concrete tests for Native/Cuda and f32/f64. Tests are now easier to read
and 5-10x shorter.

Add randomly generated test vectors for relu, sigmoid, tanh, softmax and
log softmax. LRN, pooling and convolution use old test vectors. Convolution
test fails the same way it failed before restructure.
@alexandermorozov
Copy link
Author

I've converted all remaining tests, though I haven't created new random test vectors for them, and convolution test fails as it did before. So this patchset is likely complete and can be merged after I'll convert Leaf and make sure that everything works.

Well that and I'll have to manually integrate #46 after it's meged -- I've noticed too late that @DiamondLovesYou and I have substantially refactored the same files.

Convert and use macros to make benches definitions more compact. Implement
benches for Cuda, though they take ages to complete.

Since benches are moved in main source tree, feature flag "unstable" is used
to conditionally compile them.

BREAKING CHANGE: use cargo flag "unstable" to compile benches.
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.

1 participant