relax icon indicating copy to clipboard operation
relax copied to clipboard

[Op] Implement several high-priority tensor ops: dense, conv2d, max_pool2d, relu, softmax, flatten

Open sunggg opened this issue 3 years ago • 5 comments

co-authored by: @jinhongyii

This PR implements several high-priority relax operators: dense, conv2d, max_pool2d, relu, softmax, flatten. To support these new operators, LowerWithRelayOpStrategy pass has been extended to consider attribute.

Caveat: this PR only tests a very simple case. We would like to conduct more exhaustive testing before the official usage.

cc. @YuchenJin @slyubomirsky

sunggg avatar Oct 05 '22 20:10 sunggg

For testing, there is an easy route available for gathering more test cases: You can port over some of the Relay tests for these ops, of which there are quite a few.

slyubomirsky avatar Oct 06 '22 19:10 slyubomirsky

For testing, there is an easy route available for gathering more test cases: You can port over some of the Relay tests for these ops, of which there are quite a few.

@slyubomirsky, it seems like Relay does not have comprehensive op testing neither? Seems pretty much similar with what this PR has. https://github.com/tlc-pack/relax/blob/relax/tests/python/relay/test_op_level1.py Are there more testing you are aware of?

sunggg avatar Oct 18 '22 16:10 sunggg

it seems like Relay does not have comprehensive op testing neither? Seems pretty much similar with what this PR has.

It's not perfect, but it's a start haha. Not every op has very comprehensive testing. The way to get "truly" comprehensive testing is fuzzing with a reference implementation, but that is a bit of trouble to implement...

slyubomirsky avatar Oct 19 '22 19:10 slyubomirsky

@MasterJH5574 can you help review this PR?

tqchen avatar Nov 08 '22 14:11 tqchen

agree on the runtimedep shape part, perhaps we can do one bulk change after this PR

tqchen avatar Nov 10 '22 20:11 tqchen

closing as we move to more latest updates in #332

tqchen avatar Jan 08 '23 19:01 tqchen