Skip to content

Commit

Permalink
update test for new format
Browse files Browse the repository at this point in the history
  • Loading branch information
outtanames committed Jan 26, 2024
1 parent 20cf1aa commit ef9485a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/cli/test_cli_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,21 @@ def test_catalog_path():

@skip_if_no_torch_cuda
def test_gpu_util():
import os

if os.path.exists("./test-catalog/"):
shutil.rmtree("./test-catalog/")

result = runner.invoke(app_cli, ["profile", "model", "-m", "openai/clip", "--catalog-path", "./test-catalog/"])
assert result.exit_code == 0
import os

assert os.path.exists("./test-catalog/")
# load the json manually and check the field is not 'nan':
import json

# open the first file in the tests/ dir:
# open the absolute path:
with open(os.path.join("./test-catalog/", os.listdir("./test-catalog/")[0])) as f:
catalog = json.load(f)
assert catalog["openai/clip"]["gpu_util"] != "nan"
assert catalog[0]["profiling_data"]["forward_warmup::execution"]["gpu_utilization"] != "nan"
shutil.rmtree("./test-catalog/")


Expand Down

0 comments on commit ef9485a

Please sign in to comment.