[PR #611] Hybrid EP:Support configurable IB Traffic Class via HYBRID_EP_IB_TC env var #662

Open
opened 2026-10-27 21:05:00 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/deepseek-ai/DeepEP/pull/611
Author: @kzlxd
Created: 4/24/2026
Status: 🔄 Open

Base: hybrid-ep ← Head: hybrid_ep_add_env_for_tc


📝 Commits (1)

  • 1073016 Support configurable IB Traffic Class via HYBRID_EP_IB_TC env var

📊 Changes

2 files changed (+20 additions, -2 deletions)

View changed files

📝 csrc/hybrid_ep/buffer/internode_doca.cu (+19 -1)
📝 csrc/hybrid_ep/buffer/internode_doca.cuh (+1 -1)

📄 Description

Summary

This PR adds support for configuring the IB Traffic Class (TC) used in RDMA QP setup via an environment variable, replacing the previously hardcoded value.

  • Add HYBRID_EP_IB_TC for runtime configuration
  • Remove hardcoded DEF_IB_TC = 0
  • Introduce get_ib_tc_value() with range validation (0–255)
  • Fix DOCA compilation issue by adding missing headers

This change was motivated by observed performance anomalies when using TC=0 (e.g., ~46 GB/s in 2-node dispatch scenarios), which revealed that the TC value was hardcoded.


Changes

IB TC Configuration

csrc/hybrid_ep/buffer/internode_doca.cuh

  • Remove DEF_IB_TC
  • Declare get_ib_tc_value()

csrc/hybrid_ep/buffer/internode_doca.cu

  • Implement get_ib_tc_value():

    • Read HYBRID_EP_IB_TC from environment
    • Validate range [0, 255]
    • Fall back to 0 if invalid (with warning)
  • Replace all usages of DEF_IB_TC with get_ib_tc_value()

  • Add missing includes:

    #include <torch/extension.h>
    #include


Usage

# Optional: set IB Traffic Class (default = 0)
export HYBRID_EP_IB_TC=162

python -u tests/test_hybrid_ep.py --num-processes 8
  • Values outside [0, 255] will:
    • Trigger a warning
    • Fall back to 0

Performance Impact

  • Before (TC=0): ~46 GB/s (2-node dispatch)
  • After (e.g., TC=162): significantly improved throughput

Note: exact gains depend on network configuration and topology.


Notes

  • Aligns with NVSHMEM-style runtime configurability
  • Helps avoid performance issues on certain platforms (e.g., B300 with TC=0)
  • Backward compatible (default remains TC=0)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/deepseek-ai/DeepEP/pull/611 **Author:** [@kzlxd](https://github.com/kzlxd) **Created:** 4/24/2026 **Status:** 🔄 Open **Base:** `hybrid-ep` ← **Head:** `hybrid_ep_add_env_for_tc` --- ### 📝 Commits (1) - [`1073016`](https://github.com/deepseek-ai/DeepEP/commit/1073016fe1aae7bce23a8c868d6482d6c8aa0830) Support configurable IB Traffic Class via HYBRID_EP_IB_TC env var ### 📊 Changes **2 files changed** (+20 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `csrc/hybrid_ep/buffer/internode_doca.cu` (+19 -1) 📝 `csrc/hybrid_ep/buffer/internode_doca.cuh` (+1 -1) </details> ### 📄 Description ## Summary This PR adds support for configuring the IB Traffic Class (TC) used in RDMA QP setup via an environment variable, replacing the previously hardcoded value. - Add `HYBRID_EP_IB_TC` for runtime configuration - Remove hardcoded `DEF_IB_TC = 0` - Introduce `get_ib_tc_value()` with range validation (0–255) - Fix DOCA compilation issue by adding missing headers This change was motivated by observed performance anomalies when using `TC=0` (e.g., ~46 GB/s in 2-node dispatch scenarios), which revealed that the TC value was hardcoded. --- ## Changes ### IB TC Configuration **`csrc/hybrid_ep/buffer/internode_doca.cuh`** - Remove `DEF_IB_TC` - Declare `get_ib_tc_value()` **`csrc/hybrid_ep/buffer/internode_doca.cu`** - Implement `get_ib_tc_value()`: - Read `HYBRID_EP_IB_TC` from environment - Validate range `[0, 255]` - Fall back to `0` if invalid (with warning) - Replace all usages of `DEF_IB_TC` with `get_ib_tc_value()` - Add missing includes: #include <torch/extension.h> #include <climits> --- ## Usage # Optional: set IB Traffic Class (default = 0) export HYBRID_EP_IB_TC=162 python -u tests/test_hybrid_ep.py --num-processes 8 - Values outside `[0, 255]` will: - Trigger a warning - Fall back to `0` --- ## Performance Impact - Before (`TC=0`): ~46 GB/s (2-node dispatch) - After (e.g., `TC=162`): significantly improved throughput Note: exact gains depend on network configuration and topology. --- ## Notes - Aligns with NVSHMEM-style runtime configurability - Helps avoid performance issues on certain platforms (e.g., B300 with TC=0) - Backward compatible (default remains `TC=0`) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/DeepEP#662
No description provided.