-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Fix Customize Optimization tutorial import error #18584 #18697
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
Open
AshwiniBokka
wants to merge
12
commits into
apache:main
Choose a base branch
from
AshwiniBokka:clean-tutorial-fix-18584
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+47
−5
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a65fb44
docs: update http to https in license link
AshwiniBokka 8d74f25
docs: update http to https in LICENSE file (lines 3 and 195)
AshwiniBokka fceb7da
docs: add contributor entry
AshwiniBokka 2201b99
fix: add missing trailing newline to CONTRIBUTORS.md to resolve lint …
AshwiniBokka 9a599d5
Merge branch 'main' of https://github.com/apache/tvm
AshwiniBokka 1084817
Fix Customize Optimization tutorial import error
AshwiniBokka 4f8fbac
[lint] Apply black formatting
AshwiniBokka f6b4209
[lint] Fix ASF license header in README.md
AshwiniBokka a4e83e4
Improve tutorial fix based on maintainer feedback
AshwiniBokka 2f50183
Fix black formatting for long URL line
AshwiniBokka 793758a
Fix file encoding: remove UTF-8 BOM character
AshwiniBokka 354d80b
Fix tutorial error handling logic
AshwiniBokka 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 hidden or 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 hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,6 +55,31 @@ | |
| from tvm import IRModule, relax | ||
| from tvm.relax.frontend import nn | ||
|
|
||
| # Note: This tutorial requires TVM CUDA support. | ||
| # If you encounter import errors: | ||
| # 1. First try: pip install tvm-ffi (from 3rdparty/tvm-ffi) | ||
| # 2. If that fails: Build TVM from source with CUDA enabled | ||
| # Build instructions: https://tvm.apache.org/docs/install/from_source.html | ||
|
|
||
| try: | ||
| import tvm.relax.backend.cuda.cublas as _cublas | ||
| except ImportError as e: | ||
| import sys | ||
|
|
||
| print("Error: TVM CUDA support required for this tutorial.", file=sys.stderr) | ||
| print("Solutions:", file=sys.stderr) | ||
| print(" 1. Install tvm-ffi: pip install tvm-ffi", file=sys.stderr) | ||
| print( | ||
| " 2. Build TVM with CUDA: https://tvm.apache.org/docs/install/from_source.html", | ||
| file=sys.stderr, | ||
| ) | ||
| sys.exit(1) | ||
| # If import succeeds, continue with tutorial | ||
| # If you encounter 'No module named ''tvm_ffi''' error, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The statement might not be correct, tvm_ffi is now a independent repo (and 3rdparty in tvm), I think we just need to pip install tvm-ffi if we find the |
||
| # you need to build TVM from source with CUDA enabled. | ||
| # Build instructions: https://tvm.apache.org/docs/install/from_source.html | ||
|
|
||
|
|
||
| ###################################################################### | ||
| # Composable IRModule Optimization | ||
| # -------------------------------- | ||
|
|
@@ -222,4 +247,3 @@ def transform_module(self, mod: IRModule, _ctx: tvm.transform.PassContext) -> IR | |
| # We can easily compose the optimization passes and customize the optimization for different parts | ||
| # of the computation graph. The flexibility of the optimization pipeline enables us to quickly | ||
| # iterate the optimization and improve the performance of the model. | ||
| # | ||
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.
why do we need to update license here?