Skip to content

host_ir: standardize include style#5933

Open
wujingyue wants to merge 1 commit intomainfrom
wjy/include2
Open

host_ir: standardize include style#5933
wujingyue wants to merge 1 commit intomainfrom
wjy/include2

Conversation

@wujingyue
Copy link
Collaborator

Summary

  • standardize include ordering and quote style in host_ir JIT/ops files
  • add a blank line between ATen/c10 and LLVM include groups

Testing

  • not run

@wujingyue wujingyue requested a review from naoyam February 6, 2026 18:44
@wujingyue
Copy link
Collaborator Author

!test

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

Description

  • Standardize include quote style: angle brackets <> for system/library headers (LLVM, ATen, c10), quotes " " for local project headers

  • Reorganize include ordering: group ATen/c10 includes first, then LLVM includes with blank line separator, then local project includes

  • Move runtime includes to proper position after other local includes in jit.cpp

  • Apply consistent formatting across all host_ir JIT and ops files

Changes walkthrough

Relevant files
Formatting
jit.cpp
Standardize include style and ordering                                     

csrc/host_ir/jit.cpp

  • Convert LLVM includes from quotes to angle brackets
  • Add blank line between ATen/c10 and LLVM include groups
  • Move runtime includes to end of local includes section
  • Reorganize include ordering for consistency
  • +15/-15 
    jit_external.cpp
    Standardize LLVM include style                                                     

    csrc/host_ir/jit_external.cpp

  • Convert LLVM includes from quotes to angle brackets
  • Add blank line between ATen/c10 and LLVM include groups
  • +4/-3     
    jit_tensor_utils.cpp
    Standardize LLVM include style                                                     

    csrc/host_ir/jit_tensor_utils.cpp

    • Convert LLVM includes from quotes to angle brackets
    +4/-4     
    ops.cpp
    Standardize local header include style                                     

    csrc/host_ir/ops.cpp

  • Convert main include from angle brackets to quotes
  • Convert library includes from angle brackets to quotes for local
    headers
  • Reorder includes for consistency
  • +8/-8     
    jit_external.h
    Standardize LLVM include style                                                     

    csrc/host_ir/jit_external.h

    • Convert LLVM include from quotes to angle brackets
    +1/-1     
    jit_tensor_utils.h
    Standardize include quote style                                                   

    csrc/host_ir/jit_tensor_utils.h

  • Convert LLVM includes from quotes to angle brackets
  • Convert other includes from angle brackets to quotes for local headers
  • +5/-5     
    ops.h
    Standardize local header include style                                     

    csrc/host_ir/ops.h

    • Convert includes from angle brackets to quotes for local headers
    +2/-2     

    PR Reviewer Guide

    Here are some key observations to aid the review process:

    🧪 No relevant tests
    ⚡ No major issues detected

    Test failures

    • (Medium, 3) Shape mismatch in ThunderFX higher-order inplace alias update test (test_update_aliases)

      Test Name A100 GB200 H100 Source
      thunder.tests.test_update_aliases.test_higher_order_inplace_alias_update_nvfuser_cuda_thunder.dtypes.float32
    • (Medium, 1) Thunder nvFuser NanoGPT autograd scalar mismatch in thunder/tests/test_networks

      Test Name A100 Source
      thunder.tests.test_networks.test_nanogpt_complete_autograd_nvfuser_cuda_thunder.dtypes.float32

    @greptile-apps
    Copy link
    Contributor

    greptile-apps bot commented Feb 6, 2026

    Greptile Overview

    Greptile Summary

    • Standardizes include ordering and converts LLVM includes from quotes to angle brackets across host_ir jit/tensor utils.
    • Adds an empty line separating ATen/c10 includes from LLVM includes in jit_external.cpp.
    • Switches several nvfuser/project includes in host_ir/ops* and jit_tensor_utils.h from <...> to "...", and reorders those include blocks.

    Confidence Score: 4/5

    • This PR is likely safe to merge, but verify include-path assumptions for headers switched from <...> to "..." in installed/out-of-tree builds.
    • Changes are largely mechanical include-style updates. The only plausible merge blocker is if switching project headers from angle brackets to quotes changes include resolution under certain build configurations (e.g., installed headers vs in-tree compilation). No functional code changes observed in the diff.
    • csrc/host_ir/ops.cpp, csrc/host_ir/ops.h, csrc/host_ir/jit_tensor_utils.h

    Important Files Changed

    Filename Overview
    csrc/host_ir/jit.cpp Include reordering and standardization (LLVM headers to <>; runtime/driver includes regrouped).
    csrc/host_ir/jit_external.cpp Standardizes LLVM include quote style and adds blank line between c10 and LLVM include groups.
    csrc/host_ir/jit_external.h Switches LLVM LLJIT include to angle brackets for consistency.
    csrc/host_ir/jit_tensor_utils.cpp Converts LLVM includes to angle brackets; no functional changes.
    csrc/host_ir/jit_tensor_utils.h Switches LLVM includes to <> and changes project header includes from <> to quotes (ir/all_nodes.h, type.h).
    csrc/host_ir/ops.cpp Changes project includes from <> to quotes and reorders; potential risk if build expects <> for exported include paths.
    csrc/host_ir/ops.h Changes host_ir/ir.h and ir/interface_nodes.h includes from <> to quotes; may break installs that rely on -I include paths only.

    Sequence Diagram

    sequenceDiagram
        participant Dev as Developer/Build
        participant Compiler as C++ Compiler
        participant HostIR as host_ir (jit/ops)
        participant LLVM as LLVM headers
        participant NVF as nvfuser headers
    
        Dev->>Compiler: Compile csrc/host_ir/*.cpp
        Compiler->>HostIR: Process #include directives
        HostIR->>LLVM: Include <llvm/...> (system-style)
        HostIR->>NVF: Include "..." (project headers)
        Compiler-->>Dev: Build succeeds iff include paths resolve
    
    
    Loading

    Copy link
    Contributor

    @greptile-apps greptile-apps bot left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    7 files reviewed, no comments

    Edit Code Review Agent Settings | Greptile

    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.

    1 participant