hzfan opened a new pull request #16100: Infra for tvm op runtime dispatch
URL: https://github.com/apache/incubator-mxnet/pull/16100
 
 
   ## Description ##
   This PR implements an infra to let users dispatch the execution of a tvm 
operator to different schedules according to the runtime input shapes. This 
helps with acceleration. 
   
   A gemm example can be found in
   - Kernel definition: contrib/tvmop/core/multiarray.py
   - Operator registry and dispatch: src/operator/contrib/tvmop/dot.cc
   - Benchmark: benchmark/python/tvmop/benchmark_tvmop.py
   
   Note that benchmark results cannot be reproduced until 
[this](https://github.com/dmlc/tvm/pull/3842) gets merged. The following are 
some experimental results for matrix multiplication between two n * n matrix.
   
   | n  | Before Dispatch (ms) | After Dispatch (ms) |
   | --- | --- | --- |
   | 1024  | 177 | 482 |
   | 1056  | 190 | 366 |
   | 1088 | 200 | 424 |
   
   The schedule is rough, and is equivalent to the 
[Blocking](https://docs.tvm.ai/tutorials/optimize/opt_gemm.html) optimization 
(the first step of opt). More opt (like the Vectorization, Loop Permutation, 
Array Packing, Write cache for blocks, Parallel) can be further added for 
acceleration.
   
   ## Checklist ##
   ### Essentials ###
   Please feel free to remove inapplicable items for your PR.
   - [ ] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to 
the relevant [JIRA issue](https://issues.apache.org/jira/projects/MXNET/issues) 
created (except PRs with tiny changes)
   - [x] Changes are complete (i.e. I finished coding on this PR)
   - [ ] All changes have test coverage:
   - Unit tests are added for small changes to verify correctness (e.g. adding 
a new operator)
   - Nightly tests are added for complicated/long-running ones (e.g. changing 
distributed kvstore)
   - Build tests will be added for build configuration changes (e.g. adding a 
new build option with NCCL)
   - [ ] Code is well-documented: 
   - For user-facing API changes, API doc string has been updated. 
   - For new C++ functions in header files, their functionalities and arguments 
are documented. 
   - For new examples, README.md is added to explain the what the example does, 
the source of the dataset, expected performance on test set and reference to 
the original paper if applicable
   - Check the API doc at 
http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
   - [x] To the my best knowledge, examples are either not affected by this 
change, or have been fixed to be compatible with this change
   
   ### Changes ###
   - Add dispatch infra
   - Add an example dot operator
   
   ## Comments ##
   - Thank @yzhliu and @reminisce for guidance and review.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to