Repository navigation
TT-XLA op by op parser - #143
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds initial support in the collect_data GitHub Action for parsing TT-XLA “op-by-op” pytest report artifacts into OpTest records, along with test fixtures to validate parsing behavior.
Changes:
- Introduces a new
TTXlaOpByOpParserto extract per-opOpTestentries from TT-XLA op-by-op JSON reports. - Wires the new parser into the optest report generation flow.
- Adds a pytest test plus sample op-by-op report JSON fixtures under
test/data/.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/actions/collect_data/src/parsers/tt_xla_op_by_op_parser.py | New parser for extracting OpTest entries from TT-XLA op-by-op reports. |
| .github/actions/collect_data/src/optests.py | Adds parser selection logic to route relevant reports to TTXlaOpByOpParser. |
| .github/actions/collect_data/test/test_xla_pytest_parser.py | Adds a unit test covering op-by-op parsing using fixture reports. |
| .github/actions/collect_data/test/data/xla_op_by_op_reports/op-by-op-report-1-86083933787/op_by_op_report-86083933787.json | Sample op-by-op report fixture (passed case). |
| .github/actions/collect_data/test/data/xla_op_by_op_reports/op-by-op-report-2-86083933790/op_by_op_report-86083933790.json | Sample op-by-op report fixture (failed case). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
61
to
63
| def create_optest_reports(pipeline, workflow_outputs_dir): | ||
| reports = [] | ||
|
|
vmilosevic
approved these changes
Jul 9, 2026
vmilosevic
previously approved these changes
Jul 9, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment on lines
+105
to
+123
| return OpTest( | ||
| github_job_id=github_job_id, | ||
| full_test_name=full_test_name, | ||
| test_start_ts=test_start_ts, | ||
| test_end_ts=test_end_ts, | ||
| test_case_name=name, | ||
| success=success, | ||
| skipped=skipped, | ||
| message=error_message, | ||
| config=config, | ||
| frontend=project, | ||
| model_name=model_name, | ||
| op_kind=test.get("op_kind", "") if test.get("op_kind") != "None" else "", | ||
| op_name=test.get("op_name", "").strip('"') if test.get("op_name") != "None" else "", | ||
| framework_op_name=test.get("framework_op_name", "") if test.get("framework_op_name") != "None" else "", | ||
| inputs=inputs, | ||
| outputs=outputs, | ||
| op_params=None, | ||
| ) |
Comment on lines
+68
to
+75
| for prop in user_properties: | ||
| # Look for entries with "OpTest model for: *" as the key | ||
| for key, test_data in prop.items(): | ||
| if key.startswith("OpTest model for:"): | ||
| # Extract op name from the key | ||
| op_name = key.replace("OpTest model for:", "").strip() | ||
| yield _get_pydantic_test(filepath, op_name, test_data, project, github_job_id) | ||
|
|
Comment on lines
+77
to
+79
| def _get_pydantic_test(filepath, name, test, project, github_job_id, default_timestamp=datetime.now()): | ||
| # Parse timestamps from test data | ||
| test_start_ts = ( |
|
|
||
| :param test_report: Filename of the test report | ||
| """ | ||
| return "op_by_op" in str(test_report) and str(test_report).endswith(".json") |
|
|
||
|
|
||
| class TTXlaOpByOpParser(Parser): | ||
| """Parser for python unittest report files.""" |
Comment on lines
+70
to
+71
| def _get_pydantic_test(filepath, name, test, project, github_job_id, default_timestamp=datetime.now()): | ||
| # Parse timestamps from test data |
Comment on lines
+168
to
+171
| try: | ||
| value = ast.literal_eval(value_str) | ||
| except: | ||
| value = None |
Comment on lines
+124
to
+128
| def _map_tensor_desc(tensors): | ||
| if not tensors: | ||
| return [] | ||
| for tensor in tensors: | ||
| yield TensorDesc( |
|
|
||
| :param test_report: Filename of the test report | ||
| """ | ||
| return "op_by_op" in str(test_report) and str(test_report).endswith(".json") |
vmilosevic
approved these changes
Jul 9, 2026
vmilosevic
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket
tenstorrent/tt-forge#954