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

[FixBug] Don't instantiate symbol for primitive functions #291

Merged
merged 2 commits into from Jun 26, 2023

Conversation

hjjq
Copy link
Member

@hjjq hjjq commented Jun 24, 2023

Previously, if a primitive function calls a primitive function, the instantiate_symbols pass will update the corresponding hidet.ir.primitives.func.PrimitiveFunctionRegistry.function in-place (I am not sure exactly how it's done, but this is what I observed), adding symbol variables to its parameters. The primitive function pool is a global variable, therefore this effect is cumulative across tuning candidates. So while candidate 0 will have no problem, candidate 1 will have two extra copies of symbol params, and so on, leading to compile errors.

Since primitive functions do not need symbol vars, a quick fix is just to not instantiate any symbols for them.

@yaoyaoding
Copy link
Member

yaoyaoding commented Jun 26, 2023

Thanks @hjjq!

@yaoyaoding yaoyaoding merged commit f3aad89 into hidet-org:main Jun 26, 2023
2 checks passed
@hjjq hjjq deleted the fix-pass branch June 26, 2023 17:43
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.

None yet

2 participants