-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Fixes for using Python APIs from Rust. #7085
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
Conversation
537bc18 to
0eb6aa5
Compare
|
cc @hypercubestart @binarybana @imalsogreg updated this |
56772fa to
ce92b07
Compare
This commit also updates the docs to remove outdated information.
ce92b07 to
08fddd3
Compare
hypercubestart
left a comment
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.
does this test pass now?
| let sys = py.import("tvm")?; | ||
| let version: String = sys.get("__version__")?.extract()?; | ||
| // py.run(TVMC_CODE, None, None)?; | ||
| let imported_mod = import_python(py, "tvm")?; |
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.
oops forgot to add the comment.
theres an ignored test test_run in this file, if everything works the ignore attribute should be removed
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.
This test seems to pass on most platforms but not CI, going to keep disabled until I can be sure it won't cause CI flakiness.
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.
ok, its strange to me that loading tvm into rust is flaky though
|
There seems to be a problem with scipy in the CI @jroesch ? |
vegaluisjose
left a comment
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.
LGTM
| /// Wrapper around TVM module handle which contains an entry function. | ||
| /// The entry function can be applied to an imported module through [`entry_func`]. | ||
| /// | ||
| /// [`entry_func`]:struct.Module.html#method.entry_func |
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.
is this comment still true?
| let sys = py.import("tvm")?; | ||
| let version: String = sys.get("__version__")?.extract()?; | ||
| // py.run(TVMC_CODE, None, None)?; | ||
| let imported_mod = import_python(py, "tvm")?; |
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.
ok, its strange to me that loading tvm into rust is flaky though
| /// | ||
| /// * `config` - The configuration for the compiler. | ||
| /// * `module` - The IRModule to compile. | ||
| pub fn compile_module(config: CompilerConfig, module: IRModule) -> Result<RtModule, Error> { |
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.
is there a test for this?
* Rewrite the Rust Module API and change some imports causing crashes. This commit also updates the docs to remove outdated information. * Renable Python test and remove warnings * Python test still flaky * Fix broken module test * Fix broken test * Reset test file
* Rewrite the Rust Module API and change some imports causing crashes. This commit also updates the docs to remove outdated information. * Renable Python test and remove warnings * Python test still flaky * Fix broken module test * Fix broken test * Reset test file
cc @hypercubestart this is a bigger PR to fix the current bindings and enable calling them with the Python code, but it needs a bit of cleanup, there are some changes that I used to debug segfaults.