Skip to content

Conversation

@liqiangxl
Copy link
Collaborator

@liqiangxl liqiangxl commented Nov 1, 2025

Add NVFUSER_DUMP=compile_params support

  • Added new DebugDumpOption::CompileParams to print NVRTC compilation parameters
  • Dumps all options passed to nvrtcCompileProgram including architecture flags, optimization levels, and debug options
  • Updated documentation with usage example

Usage:

NVFUSER_DUMP=compile_params

Example output:

[ RUN      ] NVFuserTest.FusionCodeGen2_CUDA
NVRTC Compile Parameters (6 options):
  --std=c++17
  --diag-suppress=177
  --gpu-architecture=sm_100a
  -default-device
  --fmad=true
  -DNDEBUG

@github-actions
Copy link

github-actions bot commented Nov 1, 2025

Description

  • Added support to dump NVRTC compilation parameters

  • Enhanced debug logging for compile-time options

  • Updated documentation for new debug option

  • Added enum and mapping for CompileParams debug option


Changes walkthrough 📝

Relevant files
Enhancement
options.cpp
Add compile_params to debug options                                           

csrc/options.cpp

  • Added new debug option "compile_params" to DebugDumpOption map
  • Mapped "compile_params" string to DebugDumpOption::CompileParams
  • +2/-1     
    compiled_kernel.cpp
    Log NVRTC compile parameters in debug mode                             

    csrc/runtime/compiled_kernel.cpp

  • Added conditional debug logging for NVRTC compile parameters
  • Logs number of options and each parameter when enabled
  • Uses isDebugDumpEnabled(DebugDumpOption::CompileParams) check
  • +7/-0     
    options.h
    Add CompileParams to DebugDumpOption enum                               

    csrc/options.h

  • Added CompileParams enum value to DebugDumpOption
  • Placed before EndOfOption placeholder
  • +1/-0     
    Documentation
    debug.md
    Document compile_params debug option                                         

    doc/dev/debug.md

  • Added documentation for NVFUSER_DUMP=compile_params
  • Described that it prints NVRTC compilation parameters
  • +1/-0     

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    🧪 No relevant tests
    ⚡ Recommended focus areas for review

    Possible Issue

    The debug print logic uses options_ directly instead of the returned opts from getOptions(), which may lead to inconsistent or incorrect parameters being logged if getOptions() performs any transformations.

    if (isDebugDumpEnabled(DebugDumpOption::CompileParams)) {
      debug() << "NVRTC Compile Parameters (" << opts.size()
              << " options):" << std::endl;
      for (const auto& opt : options_) {
        debug() << "  " << opt << std::endl;
      }

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    None yet

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    2 participants