Update python benchmarks to use direct bindings.

Open
#5,285 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
performance

Research direction

Start with benchmarks/python/core.py and the Python benchmark test files, then review the FusionDefinition API differences described in the issue. Run !test --pybench, including the benchmarks/python/host cases if retained. Done means the Python benchmarks use direct bindings and the benchmark CI command passes.

Written by the indexing model from the issue text.

Description

good first issue

We need to update the python benchmarks to use the direct bindings. I'd recommend updating the test files that only need updates to their FusionDefinition before updating core.py.

  • CI command: !test --pybench
General
  • Replace import nvfuser with import nvfuser_direct as nvfuser
Update core.py in benchmarks/python
  • Direct bindings does not use FusionCache. Remove from benchmarks/python/core.py and update benchmarks appropriately.
  • Direct bindings does not support profile argument in fd.execute. profiling was disabled for CUDA 13. Either add profiling to direct bindings or remove option from benchmarks.
  • benchmarks/python/host tests the FusionCache, so you can make a copy of core.py just for these tests OR remove the completely.
Update FusionDefinition for benchmarks.

There are some API Differences between direct and legacy bindings. Update FusionDefinition so they run correctly.

  • Replace fd.define_vector with regular python list.
V6 = fd.define_vector([T0.size(0), 1], dtype=DataType.Int)   # Not Implemented in direct bindings
V6 = [T0.size(0), 1]  # Replace with regular python list
  • Replace fd.add_output(output, stride_order) with
output = fd.stride_order(a, stride_order)
fd.add_output(output)
Dominant language
C++
Stars
404
Forks
84
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NVIDIA/Fuser

All issues in NVIDIA/Fuser

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.