Skip to content

Commit

Permalink
Fix pyre error in jagged benchmark
Browse files Browse the repository at this point in the history
Summary:
Address OSS error by explicitly convert to numpy array and also using p50 for the median
{F1461949323}

Reviewed By: PaulZhang12

Differential Revision: D54268961

fbshipit-source-id: 6b3d20b9311d462a29b6ef4964246116038a5fd4
  • Loading branch information
efiks authored and facebook-github-bot committed Feb 27, 2024
1 parent bef80ce commit 0815e0e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion torchrec/sparse/tests/jagged_tensor_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ def bench(
results = timeit.repeat(
lambda: fn(input_data[0], input_data[1]), number=10, repeat=10
)
print(f"{name} {np.median(results)*1000:.1f}us")

p_50 = np.percentile(np.asarray(results), 50)
print(f"{name} {p_50*1000:.1f}us")


@click.command()
Expand Down

0 comments on commit 0815e0e

Please sign in to comment.