Class: Ignis::Collective::Topology::Path
- Inherits:
-
Object
- Object
- Ignis::Collective::Topology::Path
- Defined in:
- lib/nvruby/collective/topology.rb
Overview
Represents a connection path between two GPUs
Instance Attribute Summary collapse
-
#dst_device ⇒ Integer
readonly
Destination GPU device ID.
-
#interconnect_type ⇒ Symbol
readonly
Interconnect type (:nvlink, :pcie_p2p, :host_staged, :none).
-
#native_atomics ⇒ Boolean
readonly
Whether native atomics are supported.
-
#p2p_supported ⇒ Boolean
readonly
Whether P2P access is supported.
-
#performance_rank ⇒ Integer
readonly
Performance rank (0 = best).
-
#src_device ⇒ Integer
readonly
Source GPU device ID.
Instance Method Summary collapse
-
#bandwidth_gbps ⇒ Float
Alias for estimated_bandwidth for test compatibility.
-
#direct_access? ⇒ Boolean
Whether direct P2P is possible.
-
#estimated_bandwidth ⇒ Float
Estimated bandwidth in GB/s.
-
#estimated_latency ⇒ Float
Estimated latency in microseconds.
-
#initialize(src_device:, dst_device:, interconnect_type:, performance_rank:, p2p_supported:, native_atomics: false) ⇒ Path
constructor
A new instance of Path.
-
#nvlink? ⇒ Boolean
Whether this path uses NVLink.
-
#pcie_p2p? ⇒ Boolean
Whether this path uses PCIe P2P.
-
#to_s ⇒ String
Human-readable description.
Constructor Details
#initialize(src_device:, dst_device:, interconnect_type:, performance_rank:, p2p_supported:, native_atomics: false) ⇒ Path
Returns a new instance of Path.
44 45 46 47 48 49 50 51 52 |
# File 'lib/nvruby/collective/topology.rb', line 44 def initialize(src_device:, dst_device:, interconnect_type:, performance_rank:, p2p_supported:, native_atomics: false) @src_device = src_device @dst_device = dst_device @interconnect_type = interconnect_type @performance_rank = performance_rank @p2p_supported = p2p_supported @native_atomics = native_atomics end |
Instance Attribute Details
#dst_device ⇒ Integer (readonly)
Returns Destination GPU device ID.
24 25 26 |
# File 'lib/nvruby/collective/topology.rb', line 24 def dst_device @dst_device end |
#interconnect_type ⇒ Symbol (readonly)
Returns Interconnect type (:nvlink, :pcie_p2p, :host_staged, :none).
27 28 29 |
# File 'lib/nvruby/collective/topology.rb', line 27 def interconnect_type @interconnect_type end |
#native_atomics ⇒ Boolean (readonly)
Returns Whether native atomics are supported.
36 37 38 |
# File 'lib/nvruby/collective/topology.rb', line 36 def native_atomics @native_atomics end |
#p2p_supported ⇒ Boolean (readonly)
Returns Whether P2P access is supported.
33 34 35 |
# File 'lib/nvruby/collective/topology.rb', line 33 def p2p_supported @p2p_supported end |
#performance_rank ⇒ Integer (readonly)
Returns Performance rank (0 = best).
30 31 32 |
# File 'lib/nvruby/collective/topology.rb', line 30 def performance_rank @performance_rank end |
#src_device ⇒ Integer (readonly)
Returns Source GPU device ID.
21 22 23 |
# File 'lib/nvruby/collective/topology.rb', line 21 def src_device @src_device end |
Instance Method Details
#bandwidth_gbps ⇒ Float
Alias for estimated_bandwidth for test compatibility
83 84 85 |
# File 'lib/nvruby/collective/topology.rb', line 83 def bandwidth_gbps estimated_bandwidth end |
#direct_access? ⇒ Boolean
Returns Whether direct P2P is possible.
67 68 69 |
# File 'lib/nvruby/collective/topology.rb', line 67 def direct_access? @p2p_supported && [:nvlink, :pcie_p2p].include?(@interconnect_type) end |
#estimated_bandwidth ⇒ Float
Estimated bandwidth in GB/s
56 57 58 |
# File 'lib/nvruby/collective/topology.rb', line 56 def estimated_bandwidth INTERCONNECT_TYPES.dig(@interconnect_type, :bandwidth_gbps) || 0 end |
#estimated_latency ⇒ Float
Estimated latency in microseconds
62 63 64 |
# File 'lib/nvruby/collective/topology.rb', line 62 def estimated_latency INTERCONNECT_TYPES.dig(@interconnect_type, :latency_us) || Float::INFINITY end |
#nvlink? ⇒ Boolean
Returns Whether this path uses NVLink.
72 73 74 |
# File 'lib/nvruby/collective/topology.rb', line 72 def nvlink? @interconnect_type == :nvlink end |
#pcie_p2p? ⇒ Boolean
Returns Whether this path uses PCIe P2P.
77 78 79 |
# File 'lib/nvruby/collective/topology.rb', line 77 def pcie_p2p? @interconnect_type == :pcie_p2p && @p2p_supported end |
#to_s ⇒ String
Returns Human-readable description.
88 89 90 91 |
# File 'lib/nvruby/collective/topology.rb', line 88 def to_s "Path[#{@src_device}→#{@dst_device}]: #{@interconnect_type} " \ "(rank=#{@performance_rank}, p2p=#{@p2p_supported})" end |