-
Notifications
You must be signed in to change notification settings - Fork 347
Remove assert on ARCH_NAME in data collection step in workflows #37300
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
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0d427a8
remove arch name req first draft
roseli-TT 6b19246
fix comments, remove grayskull refs
roseli-TT 4936af4
remove more grayskull refs
roseli-TT dc431c3
make a lil helper function to get repo root
roseli-TT 0b1d2e3
fix missed p100 in CIv2 runner name
roseli-TT 95f9364
add optional input sku_from_test
roseli-TT fb62d34
pass in sku from each test
roseli-TT 4783fc8
make matching more generic
roseli-TT 277daa2
add yaml to infra reqs because _produce-data.yaml which calls create_…
roseli-TT d13ac54
fix pip install yaml
roseli-TT 40308d8
guard against sku_config key error
roseli-TT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
5 changes: 4 additions & 1 deletion
5
.github/scripts/data_analysis/create_benchmark_with_environment_json.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,13 @@ | ||
| import sys | ||
|
|
||
| from infra.data_collection.github.utils import ( | ||
| get_github_partial_benchmark_data_filenames, | ||
| create_json_with_github_benchmark_environment, | ||
| ) | ||
|
|
||
| if __name__ == "__main__": | ||
| sku_from_test = sys.argv[1] if len(sys.argv) > 1 else None | ||
| github_partial_benchmark_data_filenames = get_github_partial_benchmark_data_filenames() | ||
|
|
||
| for benchmark_data_filename in github_partial_benchmark_data_filenames: | ||
| create_json_with_github_benchmark_environment(benchmark_data_filename) | ||
| create_json_with_github_benchmark_environment(benchmark_data_filename, sku_from_test=sku_from_test) |
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
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |||||
| from datetime import datetime | ||||||
| from typing import Optional, Union | ||||||
|
|
||||||
| import yaml | ||||||
| from loguru import logger | ||||||
|
|
||||||
| from infra.data_collection.github.workflows import is_job_hanging_from_job_log | ||||||
|
|
@@ -247,16 +248,14 @@ def get_job_row_from_github_job(github_job, github_job_id_to_annotations, workfl | |||||
| logger.info("Seems to have no config- label, so assuming no special config requested") | ||||||
| detected_config = None | ||||||
|
|
||||||
| if labels_have_overlap(["E150", "grayskull", "arch-grayskull"], labels): | ||||||
| detected_arch = "grayskull" | ||||||
| elif labels_have_overlap(["N150", "N300", "wormhole_b0", "arch-wormhole_b0", "config-t3000"], labels): | ||||||
| if labels_have_overlap(["N150", "N300", "wormhole_b0", "arch-wormhole_b0", "config-t3000"], labels): | ||||||
| detected_arch = "wormhole_b0" | ||||||
| elif labels_have_overlap(["BH", "arch-blackhole"], labels): | ||||||
| detected_arch = "blackhole" | ||||||
| else: | ||||||
| detected_arch = None | ||||||
|
|
||||||
| single_cards_list = ("E150", "N150", "N300", "BH") | ||||||
| single_cards_list = ("N150", "N300", "BH") | ||||||
roseli-TT marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| single_cards_overlap = get_overlap(single_cards_list, labels) | ||||||
roseli-TT marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| # In order of preference | ||||||
|
|
@@ -350,11 +349,15 @@ def get_job_rows_from_github_info(workflow_outputs_dir, github_jobs_json, github | |||||
| return [x for x in job_rows if x is not None] | ||||||
|
|
||||||
|
|
||||||
| def _get_repo_root() -> pathlib.Path: | ||||||
| """Return the repository root directory (parent of infra/).""" | ||||||
| return pathlib.Path(__file__).resolve().parents[3] | ||||||
|
|
||||||
|
|
||||||
| def get_github_partial_benchmark_data_filenames(): | ||||||
| logger.info("We are assuming generated/benchmark_data exists from previous passing test") | ||||||
|
|
||||||
| current_utils_path = pathlib.Path(__file__) | ||||||
| benchmark_data_dir = current_utils_path.parent.parent.parent.parent / "generated/benchmark_data" | ||||||
| benchmark_data_dir = _get_repo_root() / "generated/benchmark_data" | ||||||
| assert benchmark_data_dir.exists() | ||||||
| assert benchmark_data_dir.is_dir() | ||||||
|
|
||||||
|
|
@@ -378,7 +381,62 @@ def get_github_runner_environment(): | |||||
| } | ||||||
|
|
||||||
|
|
||||||
| def create_json_with_github_benchmark_environment(github_partial_benchmark_data_filename): | ||||||
| def _get_device_type_from_runner_environment(sku_from_test: Optional[str] = None) -> str: | ||||||
| """ | ||||||
| Infer device/card type (wormhole_b0, blackhole) from runner environment. | ||||||
| RUNNER_NAME is a GitHub Actions env var that must be set. | ||||||
|
|
||||||
| When sku_from_test is provided (e.g. from workflow), look up sku_config for that SKU's | ||||||
| runs_on labels; if any label contains "blackhole" or "wormhole", return the arch. | ||||||
| """ | ||||||
| assert "RUNNER_NAME" in os.environ, "RUNNER_NAME must be set (GitHub Actions env var)" | ||||||
| runner_name = os.environ["RUNNER_NAME"] | ||||||
| runner_lower = runner_name.lower() | ||||||
|
|
||||||
| # This assumes all CIv2 runner names start with tt-ubuntu | ||||||
| if runner_lower.startswith("tt-ubuntu"): | ||||||
| if "blackhole" in runner_lower or "bh-" in runner_lower or "p100" in runner_lower or "p150" in runner_lower: | ||||||
| return "blackhole" | ||||||
| if "n150" in runner_lower or "n300" in runner_lower or "wormhole" in runner_lower: | ||||||
| return "wormhole_b0" | ||||||
| return "unknown" | ||||||
|
|
||||||
| # Not tt-ubuntu: check .github/sku_config.yaml for arch from runs_on labels matching runner | ||||||
| if sku_from_test: | ||||||
| sku_config_path = _get_repo_root() / ".github" / "sku_config.yaml" | ||||||
| if sku_config_path.exists(): | ||||||
| with open(sku_config_path) as f: | ||||||
| config = yaml.safe_load(f) | ||||||
|
||||||
| config = yaml.safe_load(f) | |
| config = yaml.safe_load(f) or {} |
roseli-TT marked this conversation as resolved.
Show resolved
Hide resolved
roseli-TT marked this conversation as resolved.
Show resolved
Hide resolved
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,3 +6,4 @@ pydantic | |
| toolz | ||
| defusedxml | ||
| pytest | ||
| PyYAML | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.