Skip to content

[Refactor] Change Polybench Kernels Visibility to Public #331

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

Merged
merged 9 commits into from
Mar 26, 2025

Conversation

he-andy
Copy link
Contributor

@he-andy he-andy commented Mar 26, 2025

Description

The kernels provided in the examples/polybench folder can be used to write other test cases, but currently can only be accessed through a function that attaches scheduling primitives.

Proposed Solutions

All the kernels and their reference numpy reference implementations in examples/polybench are now publicly visible and can be imported into other test files.

The numpy reference implementations now also return values in addition to modifying the tensors in place (previously some would only modify in place) for consistency.

Checklist

Please make sure to review and check all of these items:

  • PR's title starts with a category (e.g. [Bugfix], [IR], [Builder], etc)
  • All changes have test coverage (It would be good to provide ~2 different test cases to test the robustness of your code)
  • Pass the formatting check locally
  • Code is well-documented

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just confirming, this is not exposed to the Allo library, right? For example, if people want to use a kernel in Polybench, they will write sth like

import examples.polybench.adi

if the path is added to the Python environment.

Copy link
Contributor Author

@he-andy he-andy Mar 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will be allo.examples. for someone who installs allo locally. Inside allo/tests it will be import examples.polybench

Nvm I just checked, it will be examples.polybench.adi

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but the current examples folder is not a subfolder of allo, so in your implementation, I don't think it can be imported using allo.examples. Also, it is not recommended to make it a submodule of Allo, as it may introduce cyclic dependency, so plz make sure it is not included under allo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've double checked by pip installing again and making a test file in another directory and it will not be included under allo.examples. and will be underexamples. as desired

@chhzh123 chhzh123 merged commit 9262cb6 into cornell-zhang:main Mar 26, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants