-
Notifications
You must be signed in to change notification settings - Fork 239
Add tests for rocprofiler-compute #2300
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
Changes from 81 commits
dc4ff25
7049feb
0513e22
04a62d1
378cbe8
018f4e4
d0179f0
dab6af3
d0f0844
872ad95
8631762
bc69dd8
11588ae
cb91113
a503de3
14b6c0f
71d1a57
b6afee3
1b2f7c0
c874209
cd9753a
32c50b1
02eb4a5
206e790
cd78323
f8f8529
b8e91d5
dc6d954
0ea61a0
3fb442b
d18097a
feeda99
ad6fa38
a4bd8dd
0cce7ec
257569a
86f04ca
d988e37
9ee4f9c
f5e9231
df38263
a5f153f
f63badf
dfa74a2
2203efe
6f1fc72
f3fa9c0
43c79aa
96554fc
5ebf1af
f6465a4
6082b1d
22fe730
51c392e
e6ab913
2e854bb
f9fee90
64a1d79
2052f4e
97a3eef
e02af57
605607d
bf4faa0
3f966f7
3e1ee69
c16068e
76542db
62e3bf9
2febf28
c49255d
0e16201
aeb0a5a
6a13bae
94dda5c
a01730f
b5e0c88
a9bf307
a70b7ce
93da344
b25961d
35c6726
4c946a9
f1330f0
3f50e59
4603da7
9dac2f6
601aa75
0864ffe
6aa966d
94c0d53
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
jbonnell-amd marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| import logging | ||
| import os | ||
| import shlex | ||
| import subprocess | ||
| from pathlib import Path | ||
|
|
||
| # Resolve paths | ||
| THEROCK_BIN_DIR = os.getenv("THEROCK_BIN_DIR") | ||
| OUTPUT_ARTIFACTS_DIR = os.getenv("OUTPUT_ARTIFACTS_DIR") | ||
| SCRIPT_DIR = Path(__file__).resolve().parent | ||
| THEROCK_DIR = SCRIPT_DIR.parent.parent.parent | ||
|
jbonnell-amd marked this conversation as resolved.
|
||
|
|
||
| THEROCK_BIN_PATH = Path(THEROCK_BIN_DIR).resolve() | ||
| THEROCK_PATH = THEROCK_BIN_PATH.parent | ||
| THEROCK_LIB_PATH = str(THEROCK_PATH / "lib") | ||
| ROCPROFILER_COMPUTE_DIRECTORY = THEROCK_PATH / "libexec" / "rocprofiler-compute" | ||
|
|
||
| # Set up ROCM_PATH | ||
| environ_vars = os.environ.copy() | ||
| environ_vars["ROCM_PATH"] = str(THEROCK_PATH) | ||
|
|
||
| # Set up PATH | ||
| old_path = os.getenv("PATH", "") | ||
|
jbonnell-amd marked this conversation as resolved.
|
||
| rocm_bin = str(THEROCK_BIN_PATH) | ||
| if old_path: | ||
| environ_vars["PATH"] = f"{rocm_bin}:{old_path}" | ||
| else: | ||
| environ_vars["PATH"] = rocm_bin | ||
|
|
||
| # Set up LD_LIBRARY_PATH | ||
| old_ld_lib_path = os.getenv("LD_LIBRARY_PATH", "") | ||
|
jbonnell-amd marked this conversation as resolved.
|
||
| sysdeps_path = f"{THEROCK_LIB_PATH}/rocm_sysdeps/lib" | ||
| if old_ld_lib_path: | ||
| environ_vars["LD_LIBRARY_PATH"] = ( | ||
| f"{THEROCK_LIB_PATH}:{sysdeps_path}:{old_ld_lib_path}" | ||
| ) | ||
| else: | ||
| environ_vars["LD_LIBRARY_PATH"] = f"{THEROCK_LIB_PATH}:{sysdeps_path}" | ||
|
|
||
| # Set up excluded tests (include Jiras) | ||
| # AIPROFSDK-36: rocr issue causing test to fail | ||
| EXCLUDED_TESTS = [ | ||
| "test_profile_pc_sampling", | ||
| ] | ||
|
|
||
| # Sharding | ||
| shard_index = int(os.getenv("SHARD_INDEX", "1")) - 1 | ||
| total_shards = int(os.getenv("TOTAL_SHARDS", "1")) | ||
|
|
||
| # Smoke Tests Setup | ||
| SMOKE_TESTS = [ | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vedithal-amd any feedback on this selection for smoke tests? We want a subset of tests to run in the regular CI with a shorter runtime (this current set takes about 10 minutes, don't want much longer than that), and the full suite will run on nightly runs. I just chose the non-profiling ones to run as smoke for now due to their shorter runtime, but open to switching these to a wider range if that would be preferred.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the point of smoke tests, will this run on every PR? This list looks good to me, lets also add
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
jbonnell-amd marked this conversation as resolved.
|
||
| "test_autogen_config", | ||
| "test_utils", | ||
| "test_num_xcds_cli_output", | ||
| "test_num_xcds_spec_class", | ||
| "test_L1_cache_counters", | ||
| "test_analyze_workloads", | ||
| "test_analyze_commands", | ||
| "test_metric_validation", | ||
| "test_profile_iteration_multiplexing_1", | ||
| ] | ||
|
|
||
| # Run tests | ||
| cmd = [ | ||
| "ctest", | ||
| "--test-dir", | ||
| f"{ROCPROFILER_COMPUTE_DIRECTORY}", | ||
|
jbonnell-amd marked this conversation as resolved.
|
||
| "--output-on-failure", | ||
| "--verbose", | ||
| "--exclude-regex", | ||
| f"{"|".join(EXCLUDED_TESTS)}", | ||
| "--tests-information", | ||
| f"{shard_index},,{total_shards}", | ||
| ] | ||
|
|
||
| # If smoke tests are enabled, we run smoke tests only. | ||
| # Otherwise, we run the normal test suite | ||
| test_type = os.getenv("TEST_TYPE", "full") | ||
| if test_type == "smoke": | ||
| cmd.append("--tests-regex") | ||
| cmd.append("|".join(SMOKE_TESTS)) | ||
|
|
||
| logging.info(f"++ Exec [{THEROCK_PATH}]$ {shlex.join(cmd)}") | ||
| subprocess.run( | ||
| cmd, | ||
| cwd=THEROCK_PATH, | ||
| check=True, | ||
| env=environ_vars, | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| #!/usr/bin/env python | ||
|
|
||
| import argparse | ||
| import logging | ||
| import os | ||
| import shlex | ||
| import subprocess | ||
| from pathlib import Path | ||
| import sys | ||
|
|
||
| SCRIPT_DIR = Path(__file__).resolve().parent | ||
| THEROCK_DIR = SCRIPT_DIR.parent | ||
| THEROCK_OUTPUT_DIR = str(THEROCK_DIR / "build") | ||
|
|
||
|
|
||
| def setup_pip(): | ||
| environ_vars = os.environ.copy() | ||
|
|
||
| setup_cmd = [ | ||
| sys.executable, | ||
| "-m", | ||
| "ensurepip", | ||
| "--upgrade", | ||
| ] | ||
| logging.info(f"++ Exec [{THEROCK_DIR}]$ {shlex.join(setup_cmd)}") | ||
| subprocess.run(setup_cmd, cwd=THEROCK_DIR, check=True, env=environ_vars) | ||
|
|
||
|
|
||
| def install_requirements(input: str): | ||
| environ_vars = os.environ.copy() | ||
|
|
||
| requirements_files = input.split(",") | ||
|
|
||
| for file in requirements_files: | ||
| cmd = [ | ||
| sys.executable, | ||
| "-m", | ||
| "pip", | ||
| "install", | ||
| "-r", | ||
| f"{THEROCK_OUTPUT_DIR}/{file}", | ||
| ] | ||
| logging.info(f"++ Exec [{THEROCK_DIR}]$ {shlex.join(cmd)}") | ||
| subprocess.run(cmd, cwd=THEROCK_DIR, check=True, env=environ_vars) | ||
|
|
||
|
|
||
| def main(argv): | ||
| parser = argparse.ArgumentParser() | ||
| parser.add_argument( | ||
| "--requirements-files", | ||
| type=str, | ||
| default="", | ||
| help="A comma separated list of requirements.txt files to install", | ||
| ) | ||
| args = parser.parse_args(argv) | ||
| if not args.requirements_files: | ||
| logging.info( | ||
| "No requirements file(s) found. Exiting install_requirements.py..." | ||
| ) | ||
| sys.exit(0) | ||
|
|
||
| setup_pip() | ||
| install_requirements(str(args.requirements_files)) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main(sys.argv[1:]) |
Uh oh!
There was an error while loading. Please reload this page.