Skip to content

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

Merged
yaoyaoding merged 2 commits intohidet-org:mainfrom
hjjq:fix-pass
Jun 26, 2023
Merged

[FixBug] Don't instantiate symbol for primitive functions#291
yaoyaoding merged 2 commits intohidet-org:mainfrom
hjjq:fix-pass

Conversation

@hjjq
Copy link
Copy Markdown
Collaborator

@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
Copy Markdown
Member

yaoyaoding commented Jun 26, 2023

Thanks @hjjq!

@yaoyaoding yaoyaoding merged commit f3aad89 into hidet-org:main Jun 26, 2023
@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.

2 participants