Skip to content

Commit

Permalink
[Smoke Test][rocPRIM] Updated smoke test to have shorter runtime and …
Browse files Browse the repository at this point in the history
…not use more than 2gb of vram (#629)

* added smoke test

* uypdated change log about bug fix for rtest.py

* updated smoketest to smoke

* fixed typo from retest to rtest

* updated changelog

* added new smoketest

* updated smoke test to be inclusive

* added back old smoke test as smoke_old

* added --emulation/-e option

* updated changelog

* updated changelog with instructions to run old smoke test
  • Loading branch information
NguyenNhuDi authored Nov 12, 2024
1 parent f37b344 commit 20b38ee
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@

Full documentation for rocPRIM is available at [https://rocm.docs.amd.com/projects/rocPRIM/en/latest/](https://rocm.docs.amd.com/projects/rocPRIM/en/latest/).


## (Unreleased) rocPRIM 3.4.0 for ROCm 6.4.0

### Added

* Added the parallel `find_first_of` device function with autotuned configurations, this function is similar to `std::find_first_of`, it searches for the first occurrence of any of the provided elements.
* Added `--emulation` option added for `rtest.py`
* Unit tests can be ran with `[--emulation|-e|--test|-t]=<test_name>`

### Changed
* Modified smoke tests to complete in faster run-time and to never exceed 2GB of vram usage
* Old smoke tests can be ran with python3 rtest.py --test/-t smoke_old or python3 rtest.py --emulation/-e smoke_old instead
* `--test|-t` no longer a required flag for `rtest.py`, instead user can use either `--emulation|-e` or `--test|-t` but not both


### Resolved issues

Expand Down
35 changes: 32 additions & 3 deletions rtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ def parse_args():
parser = argparse.ArgumentParser(description="""
Checks build arguments
""")
parser.add_argument('-t', '--test', required=True,
help='Test set to run from rtest.xml (required, e.g. osdb)')
parser.add_argument('-e', '--emulation', required=False, default="",
help='Test set to run from rtest.xml (optional, eg.smoke). At least one but not both of -e or -t must be set')
parser.add_argument('-t', '--test', required=False, default="",
help='Test set to run from rtest.xml (optional, e.g. osdb). At least one but not both of -e or -t must be set')
parser.add_argument('-g', '--debug', required=False, default=False, action='store_true',
help='Test Debug build (optional, default: false)')
parser.add_argument('-o', '--output', type=str, required=False, default="xml",
Expand Down Expand Up @@ -247,6 +249,11 @@ def batch(script, xml):
for test in xml.getElementsByTagName('test'):
sets = test.getAttribute('sets')
runset = sets.split(',')

A, B = args.test != '', args.emulation != ''
if not (A ^ B):
raise ValueError('At least one but not both of -e/--emulation or -t/--test must be set')

if args.test in runset:
for run in test.getElementsByTagName('run'):
name = run.getAttribute('name')
Expand All @@ -268,6 +275,28 @@ def batch(script, xml):
error = run_cmd(var_cmd, True, timeout)
if (error == 2):
print( f'***\n*** Timed out when running: {name}\n***')

if args.emulation in runset:
for run in test.getElementsByTagName('run'):
name = run.getAttribute('name')
vram_limit = run.getAttribute('vram_min')
if vram_limit:
if OS_info["VRAM"] < float(vram_limit):
print( f'***\n*** Skipped: {name} due to VRAM req.\n***')
continue
if name:
print( f'***\n*** Running: {name}\n***')
time_limit = run.getAttribute('time_max')
if time_limit:
timeout = float(time_limit)
else:
timeout = 0

raw_cmd = run.firstChild.data
var_cmd = raw_cmd.format_map(var_subs)
error = run_cmd(var_cmd, True, timeout)
if (error == 2):
print( f'***\n*** Timed out when running: {name}\n***')
else:
error = run_cmd(cmd)
fail = fail or error
Expand Down Expand Up @@ -321,4 +350,4 @@ def main():
sys.exit(status)

if __name__ == '__main__':
main()
main()
8 changes: 7 additions & 1 deletion rtest.xml

Large diffs are not rendered by default.

0 comments on commit 20b38ee

Please sign in to comment.