-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add script to generate tripy integration test stablehlo ir #490
base: main
Are you sure you want to change the base?
Add script to generate tripy integration test stablehlo ir #490
Conversation
for test_name, asm in test_assemblies.items(): | ||
f.write(f' "{test_name}": """{asm}""",\n') | ||
|
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.
How large is the generated code usually? Wondering if we might need to split them across tests instead of just test files?
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.
I have not generated the code for the complete test suit (WIP). I will update once done.
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.
Generated code is about 30k lines and takes around 15 minutes to run end to end in MLIR-TRT. May be we can perform some deduplication i.e. just include first test case in a class. or may be just include a single test per module.
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 a naive deduplication help at all? e.g. just comparing the generated StableHLO textual representation directly
module_match = re.search(r'<Module (.*?)>', relevant_output) | ||
module_name = module_match.group(1) if module_match else '' | ||
class_match = re.search(r'<Class (.*?)>', relevant_output) | ||
class_name = class_match.group(1) if class_match else '' |
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 might be incorrect if we have more than one class per module.
This script can be run periodically (or during CI/CD) to generate Tripy integration test IRs. For now, we generate stablehlo IR but script itself is IR agonistic. This will generate a file
test_tripy_integration.py
which can be copied tomlir-tensorrt/compiler/test/python/IntegrationTests/test_tripy_integration.py
and committed to mitigating Tripy related regressions in MLIR-TensorRT.