Skip to content

Commit

Permalink
[Smoke Test][hipCUB] Implemented smoketest for emulation work (#419)
Browse files Browse the repository at this point in the history
* added new smoketest for emulation work

* updated changelog
  • Loading branch information
NguyenNhuDi authored Nov 12, 2024
1 parent 9be514c commit 97469b2
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 6 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@ Full documentation for hipCUB is available at [https://rocm.docs.amd.com/project
### Added
* Added `ForEach`, `ForEachN`, `ForEachCopy`, `ForEachCopyN` and `Bulk` functions to have parity with CUB.
* Added the `hipcub::CubVector` type for CUB parity.
* Added `--emulation` option added for `rtest.py`

### Changed
* Edited smoke test options, which runs a subset of the unit tests and ensuring that less than 2gb of VRAM will be used
* Smoke tests can be ran with `[--emulation|-e|--test|-t]=smoke`
* `--test|-t` no longer a required flag for `rtest.py`, instead user can use either `--emulation|-e` or `--test|-t` but not both

## hipCUB-3.3.0 for ROCm 6.3.0

### Fixed

* Not all headers in hipCUB included `config.hpp` which could have resulted in build errors.

### Added
Expand Down
36 changes: 32 additions & 4 deletions rtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ def parse_args():
parser = argparse.ArgumentParser(description="""
Checks build arguments
""")
parser.add_argument('-t', '--test', required=True, type=str, action='append',
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 @@ -245,7 +247,11 @@ def batch(script, xml):
global OS_info
global args
global fail_regex
#

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')

cwd = pathlib.os.curdir
rtest_cwd_path = os.path.abspath( os.path.join( cwd, 'rtest.xml') )
if os.path.isfile(rtest_cwd_path) and os.path.dirname(rtest_cwd_path).endswith( "staging" ):
Expand Down Expand Up @@ -306,7 +312,29 @@ def batch(script, xml):
for test in xml.getElementsByTagName('test'):
sets = test.getAttribute('sets')
runset = sets.split(',')
if len([x for x in args.test if x in runset]):
if args.test 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***')
continue
if args.emulation in runset:
for run in test.getElementsByTagName('run'):
name = run.getAttribute('name')
vram_limit = run.getAttribute('vram_min')
Expand Down
6 changes: 5 additions & 1 deletion rtest.xml

Large diffs are not rendered by default.

0 comments on commit 97469b2

Please sign in to comment.