Skip to content
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

auto_schedule with python_bindings #6791

Closed
lukastruemper opened this issue May 31, 2022 · 2 comments
Closed

auto_schedule with python_bindings #6791

lukastruemper opened this issue May 31, 2022 · 2 comments

Comments

@lukastruemper
Copy link
Contributor

lukastruemper commented May 31, 2022

Hello,

I started using the Halide python_bindings and wanted to use the autoschedulers. I tried to wrap the blur.py example into a pipeline and call auto_schedule with Adams2019:

pipeline = hl.Pipeline(blur)
pipeline.auto_schedule("Adams2019", hl.get_target_from_environment())

This results in an error that "Adams2019" is not found, but it seems like are no autoschedulers registered

Traceback (most recent call last):
  File "/home/lukas/Documents/repos/Halide/python_bindings/apps/blur.py", line 81, in <module>
    main()
  File "/home/lukas/Documents/repos/Halide/python_bindings/apps/blur.py", line 62, in main
    pipeline.auto_schedule("Adams2019", hl.get_target_from_environment())
RuntimeError: Error: Unknown autoscheduler name 'Adams2019'; known names are:

Is there a technical problem with how the auto-schedulers work (construct the features from the python interface?) or is it just a problem of correctly building the bindings?

Would be cool if we could get this to work. I am trying to understand the performance of Halide on NPBench and compare it with pythonic DSLs like numpy and DaCe.

Cheers,
Lukas

@steven-johnson
Copy link
Contributor

You need to call hl.load_plugin('autoschedule_adams2019') at some point before calling the auto_schedule method, and you need to ensure that libautoschedule_adams2019.so is in the search path (e.g. by setting LD_LIBRARY_PATH appropriately). (Windows/OSX specifics may vary slightly.)

(Yes, this is inconvenient. We're working on putting in proper support for Generators via Python (#6764) which will hopefully streamline issues like this.)

@lukastruemper
Copy link
Contributor Author

Cool, this worked. Thanks!

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

No branches or pull requests

2 participants