Skip to content

Commit

Permalink
added smoketest option to run smoke tests in retest.py (#594)
Browse files Browse the repository at this point in the history
* added smoke test

* uypdated change log about bug fix for rtest.py

* updated smoketest to smoke

* fixed typo from retest to rtest
  • Loading branch information
NguyenNhuDi authored Aug 15, 2024
1 parent 7962dcd commit e5103be
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Documentation for rocPRIM is available at
## Unreleased rocPRIM-3.3.0 for ROCm 6.3.0

### Additions

* Add --test smoke option in rtest.py. It will run a subset of tests such that the total test time is in 5 minutes. Use python3 ./rtest.py --test smoke or python3 ./rtest.py -t smoke to execute smoke test.
* Option `--seed` to benchmarks to specify a seed for the generation of random inputs. The default behavior is to keep using a random seed per benchmark measurement.
* Added configuration autotuning to device partition (`rocprim::partition`, `rocprim::partition_two_way`, and `rocprim::partition_three_way`), device select (`rocprim::select`, `rocprim::unique`, and `rocprim::unique_by_key`), and device reduce by key (`rocprim::reduce_by_key`) for improved performance on selected architectures.
* Added `rocprim::uninitialized_array` which provides uninitialized storage in local memory for user-defined types.
Expand All @@ -21,7 +21,7 @@ Documentation for rocPRIM is available at
* Changed the default seed for `device_benchmark_segmented_reduce`.

### Fixes

* Fixed an issue in rtest.py where if the build folder was made without release or debug directory it would crash the program
* Fixed an issue where while running rtest.py on windows and passing in an absolute path to `--install_dir` causes a `FileNotFound` error.
* rocPRIM functions are no longer forcefully inlined on Windows, significantly reducing the build
time in debug builds.
Expand Down
26 changes: 19 additions & 7 deletions rtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def run_cmd(cmd, test = False, time_limit = 0):
else:
error = False
timeout = False
test_proc = subprocess.Popen(shlex.split(cmdline), text=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
test_proc = subprocess.Popen(cmdline, text=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
if time_limit > 0:
start = time.monotonic()
#p = multiprocessing.Process(target=time_stop, args=(start, test_proc.pid))
Expand Down Expand Up @@ -205,15 +205,27 @@ def batch(script, xml):
#
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" ):
# if in a staging directory then test locally
test_dir = cwd
else:
if args.debug: build_type = "debug"
else: build_type = "release"
# deal with windows pathing
install_dir = '//'.join(args.install_dir.split('\\'))
test_dir = f"{install_dir}//{build_type}//test"

if args.debug:
build_type = "debug"
else:
#check if we have a release folder in build
if os.path.isdir(f'{install_dir}//release//test'):
build_type = "release"
else:
build_type = ""

if len(build_type) > 0:
test_dir = f"{install_dir}//{build_type}//test"
else:
test_dir = f"{install_dir}//test"
fail = False
for i in range(len(script)):
cmdline = script[i]
Expand Down Expand Up @@ -259,7 +271,6 @@ def batch(script, xml):
else:
error = run_cmd(cmd)
fail = fail or error

if (fail):
if (cmd == "%XML%"):
print(f"FAILED xml test suite!")
Expand All @@ -270,6 +281,7 @@ def batch(script, xml):
return 1
if (os.curdir != cwd):
os.chdir( cwd )

return 0

def run_tests():
Expand Down Expand Up @@ -303,8 +315,8 @@ def main():

status = run_tests()

if args.fail_test: status = 1

if args.fail_test:
status = 1
if (status):
sys.exit(status)

Expand Down
4 changes: 4 additions & 0 deletions rtest.xml

Large diffs are not rendered by default.

0 comments on commit e5103be

Please sign in to comment.