Skip to content

Commit

Permalink
Test utils fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gshtras committed Jan 21, 2025
1 parent b254aa9 commit c6ab652
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,11 @@ def measure_current_non_torch():
# Add some extra non-torch memory 256 MiB (simulate NCCL)
handle2 = lib.cudaMalloc(256 * 1024 * 1024)

# this is an analytic value, it is exact,
# we only have 256 MiB non-torch memory increase
measured_diff = monitored_values.values[-1] - monitored_values.values[0]
assert measured_diff == 256 * 1024 * 1024

# Check that the memory usage is within 5% of the expected values
# 5% tolerance is caused by cuda runtime.
# we cannot control cuda runtime in the granularity of bytes,
Expand Down

0 comments on commit c6ab652

Please sign in to comment.