降级轴摄取 — TpuDegradedAxesProto → Target 降级字节 → 弹性 ND 环
此页面上的所有地址适用于
libtpu-0.0.40-cp314轮子中的libtpu.so(构建 ID89edbbe81c5b328a958fe628a9f2207d)。其他版本会有所不同。.textVMA等于文件偏移量;所有地址均为 VMA。
摘要
当 TPU 切片上的 ICI 链路在启动时失败时,不会放弃该切片。运行时记录错误链接属于哪个环面轴,通过编译将这一事实作为三个布尔值传递,并且集体环选择器将降级轴从主全归约环中折叠出来。本页记录了该机制的 生产者 端:如何将错误链接 方向 简化为每轴降级字节、它所进入的原型和 POD、Target 结构摄取以及消耗它的每颜色 RingLocation 环构造折叠。 picker 侧 — GetDegradedAxis、InitColorDimensionsDegraded、弹性门和 IciResource 槽位图 — 位于 SelectND策略 上;此页面链接它而不是复制它。
摄取脊柱由三个功能组成。 tpu::OrientationsToTpuDegradedAxes (0x1fc57d00) 将故障链接 Orientation 枚举值的向量映射到三个降级字节(方向 1→X、2→Y、3→Z)。这些字节流经 TpuDegradedAxesProto{x,y,z}(在 TpuConfiguredPropertiesProto 中嵌套为 degraded_axes 的 3-bool 原型)和并行 8 字节进程内 POD tpu::TpuConfiguredProperties。 xla::jellyfish::target::CreateFromTopology (0x1d48e520) 是编写器:它将四个平面配置字节复制到 Target[+0x3f8..+0x3fb] 中,并将路由策略 int32 复制到 Target[+0x3fc] 中。从那里开始,降级的字节三元组 Target[+0x3f8..+0x3fa] 正是 Target::Is{X,Y,Z}Degraded 读取的内容,以及 StrategyND::BuildStrategy (0x137c4660) 在 AllReduce 发射器行走的每颜色 RingLocation 坐标构建中反映的内容。
了解 MPI 容错集体的读者拥有该框架:这是一个单轴“围绕死链接的路由”记录,从链接发现通过编译器线程化到物理环几何结构。重新实施合同是:
- 原型 + POD 布局。
TpuDegradedAxesProto(3 个布尔字段,线标记0x08/0x10/0x18,内存中字节+0x18/+0x19/+0x1a、has 位[+0x10]位 1/2/4)、其父TpuConfiguredPropertiesProto以及编译路径通过 const 引用传递的平面 8 字节tpu::TpuConfiguredPropertiesPOD。 - 方向→字节映射。
OrientationsToTpuDegradedAxes:密集枚举0..6,仅值1/2/3设置X/Y/Z降级字节;0=UNKNOWN和4/5/6未设置任何内容。 Target写入。CreateFromTopology逐字节:cfg[+0..+3] → Target[+0x3f8..+0x3fb]、cfg[+4](或默认topo[+0xa4])→ Target[+0x3fc]。- 环形结构折叠。
BuildStrategy的[obj+0xa8]==1ND 环门、每颜色color_dimsmemmove扇出以及转动(可能是降级重新映射)的每颜色RingLocation坐标构建[6][3]颜色尺寸表放入发射器穿过的物理环中。
| 方向→字节图 | tpu::OrientationsToTpuDegradedAxes @ 0x1fc57d00 (0x2e0 B) |
| 链接源错误 | accel_ssw::deepsea::slice_builder::SliceBuilderHelper::StatSession @ 0x1fbb5b80 |
| 线路原型 | tpu::TpuDegradedAxesProto(3 个布尔值)嵌套在 TpuConfiguredPropertiesProto.degraded_axes(字段 1)中 |
| 序列化器(布局证明) | TpuDegradedAxesProto::_InternalSerialize @ 0x20adb880 |
| 扁平 POD | tpu::TpuConfiguredProperties(8字节:x,y,z,nhop,路由策略) |
| 默认 POD | tpu::GetDefaultConfiguredProperties @ 0x20acee40(降级字节 = 0) |
| 作家 | xla::jellyfish::target::CreateFromTopology(…,TpuConfiguredProperties&,…) @ 0x1d48e520 |
| 降级字节 | Target[+0x3f8] (X)、[+0x3f9] (Y)、[+0x3fa] (Z);路由 [+0x3fc] |
| 配件 | Target::IsXDegraded @ 0x1d615940 / IsYDegraded @ 0x1d615960 / IsZDegraded @ 0x1d615980 |
| 建环器 | xla::jellyfish::StrategyND::BuildStrategy @ 0x137c4660 (0xca0 B) |
| 消费者(拣货员) | GetDegradedAxis @ 0x1c894c20、InitColorDimensionsDegraded @ 0x137c6580 — 参见 SelectND策略 |
| 信心 | HIGH(所有摄取函数的反编译验证主体),除非行/标注另有说明 |
这在哪里
降级轴路径将 ICI 引入到集体拾取器中。上游、ICI 结构中的链路发现和故障处理 — 请参阅 ICI 故障模式和恢复;失败的链接会产生此页面摄取的错误链接方向。下游,该页写入 Target 的字节三元被以下各项消耗:
- 弹性 ND 环拾取器 — SelectND策略 上的
GetDegradedAxis/InitColorDimensionsDegraded/UseResilientAlgorithmBase。该页面拥有“消耗”:将三个降级字节减少到一个轴索引(或-1),以及[6][3]颜色尺寸重新映射。 - 成本模型 — 降级轴的两个
IciResource插槽离开主环,从而删除num_dims除数3 → 2;参见 SPMD 链路计数成本。 - 扭曲圆环弹性变体 —
UseResilientAlgorithmTwistedTorus重复使用相同的退化栅极;扭曲环几何形状位于 扭曲环面概述 和 TwistedTorusND::BuildStrategy 上。
此页面拥有原始摄取、降级表示以及降级下的 RingLocation 结构 - SelectNDStrategy 消耗的生产者端。
ICI link fails at bring-up (ICI Failure Modes & Recovery)
│ faulty-link Orientation enum (1/2/3 = +X/+Y/+Z axis)
▼
SliceBuilderHelper::StatSession → OrientationsToTpuDegradedAxes (enum → x/y/z bytes)
│
▼
TpuDegradedAxesProto{x,y,z} ⊂ TpuConfiguredPropertiesProto.degraded_axes
│ ≡ tpu::TpuConfiguredProperties POD (+0 x, +1 y, +2 z, +3 nhop, +4 routing)
▼
target::CreateFromTopology → Target[+0x3f8..+0x3fc]
│
▼
GetDegradedAxis / InitColorDimensionsDegraded → [6][3] color_dims (SelectNDStrategy)
│
▼
StrategyND::BuildStrategy → per-color RingLocation → AllReduce emitter walk
```text
---
## Proto 和 POD 布局
降级记录以两种并行形式存在:可序列化的原型(用于跨运行时/编译器边界携带配置并进入编译缓存键)和通过 const 引用通过进程内编译路径传递的平面 8 字节 POD。
### `TpuDegradedAxesProto` — 三个布尔值
在 `…/tpu/runtime/topology/tpu_routing_strategy.proto`(proto3/版本)中定义。字节精确的内存布局直接从 `TpuDegradedAxesProto::_InternalSerialize` (`0x20adb880`) 读取:
```protobuf
message TpuDegradedAxesProto { // descriptor ".tpu.TpuDegradedAxesProto"
bool x = 1; // wire tag 0x08; in-mem byte [this+0x18]; has-bit [this+0x10] & 0x1
bool y = 2; // wire tag 0x10; in-mem byte [this+0x19]; has-bit [this+0x10] & 0x2
bool z = 3; // wire tag 0x18; in-mem byte [this+0x1a]; has-bit [this+0x10] & 0x4
}序列化器主体独立地证明每个字段 - has-bit & {1,2,4} 和值字节 == 1,然后发出 {tag, value}:
// TpuDegradedAxesProto::_InternalSerialize @ 0x20adb880 (has-bits in *((_DWORD*)this+4) = [this+0x10])
int v4 = *((_DWORD *)this + 4);
if ((v4 & 1) && *((_BYTE *)this + 24) == 1) { *a2 = 8; a2[1] = 1; a2 += 2; } // x: tag 0x08, byte 0x18
if ((v4 & 2) && *((_BYTE *)this + 25) == 1) { *a2 = 16; a2[1] = 1; a2 += 2; } // y: tag 0x10, byte 0x19
if ((v4 & 4) && *((_BYTE *)this + 26) == 1) { *a2 = 24; a2[1] = 1; a2 += 2; } // z: tag 0x18, byte 0x1a
```text
`TpuDegradedAxesProto` 嵌套为 `TpuConfiguredPropertiesProto` 的 **字段 1 `degraded_axes`**,以及字段 2 `is_nhop_source_relative`(布尔)和字段 3 `routing_strategy`(`TpuRoutingStrategyProto` 枚举)。三个降级布尔值按 X/Y/Z 顺序一对一映射到 `Target[+0x3f8]`/`[+0x3f9]`/`[+0x3fa]` — 读取的字节 `Target::Is{X,Y,Z}Degraded`(请参阅 [SelectND策略](strategy-nd-picker.md))。
### `tpu::TpuConfiguredProperties` — 平面 8 字节 POD
进程内形式是一个与线路原型不同的 8 字节 POD。它由 `const&` 通过编译路径(`TpuJitCompileTF`、`BuildXLADeviceAssignment`、`TpuMeshCommonState` ctor、`TpuTopologyDescription`、编译缓存)传递,并在缓存原始密钥中格式化为 `"degraded_axes("`(`GenerateCacheRawKey`、 `.rodata 0xa17d7d6`,紧接在 `0xa17d7d5` 处的 `:` 分隔符之后):
| 偏移 | 字段 | 源码 |
|---|---|---|
| `+0x0` | `byte x_degraded` | `TpuDegradedAxesProto.x` |
| `+0x1` | `byte y_degraded` | `.y` |
| `+0x2` | `byte z_degraded` | `.z` |
| `+0x3` | `byte is_nhop_source_relative` | `TpuConfiguredPropertiesProto` 字段 2 |
| `+0x4` | `int32 routing_strategy` | 字段 3;默认`= topo[+0xa4]` |
无降级默认值由 `tpu::GetDefaultConfiguredProperties` (`0x20acee40`) 构建,它返回打包成单个 64 位值的 POD,并将降级字节清零:
```c
// GetDefaultConfiguredProperties @ 0x20acee40 (this = TpuTopology; +41*4 = topo[+0xa4])
return ((uint64_t)topo[+0xa4] << 32) | ((uint8_t)(topo[+0xa4] == 2) << 24);
// ^ routing_strategy in high dword ^ is_nhop_source_relative = (routing==2)
// x = y = z = 0 (no degraded link in the default path)注意 — 默认打包将
routing_strategy置于高位双字中,将is_nhop_source_relative置于第 24 位(POD 字节+0x3),+0x0..+0x2处的三个降级字节保留为零。降级的切片通过OrientationsToTpuDegradedAxes(如下)到达,而不是GetDefaultConfiguredProperties。
方向→降级字节图
OrientationsToTpuDegradedAxes — 0x1fc57d00
该函数将故障链路 Orientation 枚举值的向量减少到三个降级字节。它的参数是 absl::StatusOr<std::vector<Orientation>>; Orientation 是密集枚举 accel_ssw::deepsea::proto::Orientation(0..6、0 = UNKNOWN_ORIENTATION)。仅值 1、2、3 设置降级字节:
// tpu::OrientationsToTpuDegradedAxes @ 0x1fc57d00 (8-at-a-time unrolled int32 walk)
// x = v8, y = v10, z = v9 (decompiler temporaries)
char x = 0, y = 0, z = 0;
for (int orient : vec) { // vec = StatusOr.value() if ok; else propagate status
if (orient == 1) x = 1; // Orientation +X ⇒ X axis degraded
if (orient == 2) y = 1; // Orientation +Y ⇒ Y axis degraded
if (orient == 3) z = 1; // Orientation +Z ⇒ Z axis degraded
}
result[0x8] = x; result[0x9] = y; result[0xa] = z; result[0] = ok(=1);
```text
反编译后的`LABEL_75`尾声写入`result[8] = v8 (x)`、`result[9] = v10 (y)`、`result[10] = v9 (z)`、`result[0] = 1`,确认枚举到字节的映射:方向`1`→X, `2`→Y,`3`→Z。如果输入 `StatusOr` 不正常 (`*(a2) != 1`),则该函数会传播状态而不触及字节。
> **GOTCHA —** 反编译中的 `switch` 调度 `case 1 → x`、`case 3 → z`、`case 2 → y`。 *result* 结构中的 X/Y/Z 字节槽为 `+8`/`+9`/`+0xa`,按 X/Y/Z 顺序,与原始字节 `+0x18`/`+0x19`/`+0x1a` 和`Target` 字节 `+0x3f8`/`+0x3f9`/`+0x3fa`。重新推导时不要调换 Y 和 Z — 反编译器的 `v9`/`v10` 临时编号会交换它们,但*字节存储*是 X@+8、Y@+9、Z@+0xa。
密集枚举运行 `0..6`。运行时调用方注释 `"Only one faulty orientation is allowed but found two:"` (`.rodata`) 镜像 `GetDegradedAxis`(`≥2 degraded ⇒ -1`,在 [SelectND策略](strategy-nd-picker.md) 上)下游强制执行的单轴约束。
> **注意 — 置信度低(方向 4/5/6)。** `OrientationsToTpuDegradedAxes` 仅测试 `== 1`、`== 2`、`== 3`;枚举值 `4/5/6` 不会产生降级字节。 `4/5/6` 是否是负轴方向(`-X/-Y/-Z`,理想情况下会折叠到同一轴字节)或不同的含义仅从该函数中无法得到确认 - 它只是忽略它们。
### `SliceBuilderHelper::StatSession` — 故障链路源 (`0x1fbb5b80`)
`OrientationsToTpuDegradedAxes` 的唯一调用者(通过 `.text` 的调用站点扫描进行验证)是切片构建器的会话统计路径。它根据切片上观察到的故障链接组装 `std::vector<Orientation>`,调用 `OrientationsToTpuDegradedAxes` (`0x1fbb5e4c`),然后将三个结果字节加上第四个字节打包到单个双字中以作为切片信息摘要:
```text
ecx = (x & 1) | ((y & 1) << 8) | ((z & 1) << 16) | (w << 24); // w from a local
[SliceInformation + 0x8] = ecx; [SliceInformation + 0x0] = ok(=1);双字位布局(x@0、y@8、z@16、w@24)正是下面作者使用的 tpu::TpuConfiguredProperties 的 4 字节前缀。
Target 写入 — CreateFromTopology
xla::jellyfish::target::CreateFromTopology(…,TpuConfiguredProperties&,…) — 0x1d48e520
这是将降级配置放置在 Target 结构中的函数。通过解析的工厂指针(来自 target::GetForVersion、0x1d49f500)构造每个 TpuVersion 原始 Target 后,它将四个平面配置字节从 TpuConfiguredProperties& (a5) 复制到 Target 并解析路由策略:
// CreateFromTopology @ 0x1d48e520 (v14 = constructed Target; a5 = TpuConfiguredProperties&; a2 = TpuTopology*)
*(_BYTE *)(v14 + 1016) = *(_BYTE *)a5; // cfg[+0] → Target+0x3f8 IsXDegraded
*(_BYTE *)(v14 + 1017) = *((_BYTE *)a5 + 1); // cfg[+1] → Target+0x3f9 IsYDegraded
*(_BYTE *)(v14 + 1018) = *((_BYTE *)a5 + 2); // cfg[+2] → Target+0x3fa IsZDegraded
*(_BYTE *)(v14 + 1019) = *((_BYTE *)a5 + 3); // cfg[+3] → Target+0x3fb is_nhop_source_relative
int v15 = *((_DWORD *)a5 + 1); // cfg[+4] routing_strategy
if (!v15) v15 = *((_DWORD *)a2 + 41); // if zero, default = topo[+0xa4]
*(_DWORD *)(v14 + 1020) = v15; // → Target+0x3fc
*(_QWORD *)(v14 + 2344) = a6; // MultiSliceTopologyAndLocation* → Target+0x928
*(_BYTE *)(v14 + 2352) = a7; // bool → Target+0x930
```text
偏移量是字节精确的:`1016 = 0x3f8`、`1017 = 0x3f9`、`1018 = 0x3fa`、`1019 = 0x3fb`、`1020 = 0x3fc`。这是 `Target::IsXDegraded` 访问器(`return *((uint8_t*)this + 1016)`、`0x1d615940`)的逆过程,关闭从原始字节到 `Target` 字节再到访问器的往返。
| 目标偏移 | 字段 | 源字节 |
|---|---|---|
| `+0x3f8` | `IsXDegraded` | `cfg[+0]`(原型`degraded_axes.x`) |
| `+0x3f9` | `IsYDegraded` | `cfg[+1]` (`.y`) |
| `+0x3fa` | `IsZDegraded` | `cfg[+2]` (`.z`) |
| `+0x3fb` | `is_nhop_source_relative` | `cfg[+3]` |
| `+0x3fc` | `routing_strategy` (`int32`) | `cfg[+4]`,或 `topo[+0xa4]`(如果为零) |
| `+0x928` | `MultiSliceTopologyAndLocation*` | 参数 `a6` |
| `+0x930` | 布尔值 | 参数 `a7` |
两个薄的默认配置包装器为作者提供了信息。两者都首先调用 `GetDefaultConfiguredProperties`(因此降级字节为零),然后尾调用此编写器:`(TpuTopology const*, long)` 重载(`0x1d48e460`,由 `CreateTargetFromDeepseaPlatform`、`0x10a4efe0` 调用)和 `(TpuTopology const*, long, long, MultiSliceTopologyAndLocation const*)` 重载(`0x1d48e4c0`,由`tensorflow::GetTargetDescription`、`0xe9745e0`)。仅当调用者将由 `OrientationsToTpuDegradedAxes` 填充的 `TpuConfiguredProperties` 直接线程到此编写器重载中时,降级字节才会变为非零。
> **注意 —** `routing_strategy` 零均值默认规则 (`if (!cfg[+4]) cfg[+4] = topo[+0xa4]`) 是字节摄取中的唯一分支 - 每个降级字节都是无条件副本。重新实现者必须仅将拓扑默认值应用于路由双字,而不是降级的字节。
---
## `RingLocation` 建筑正在退化
`StrategyND::BuildStrategy`(`0x137c4660`、0xca0 B;源 `all_reduce_strategies.cc`)是(可能降级重新映射的)`[6][3]` 颜色维度表成为物理每颜色 `RingLocation` 设置的位置AllReduce 发射器行走。降级的折叠不会改变 *this* 函数的结构 - `BuildStrategy` 读取 `color_dims` `ComputeColorDimensions` 生成的任何内容,并且在降级的切片上,该表来自 `InitColorDimensionsDegraded`(死轴降级到列 `[2]`;请参阅 [SelectND策略](strategy-nd-picker.md))。因此,降解的影响是“重新排序”`color_dims` 为未更改的环生成器提供数据。
### `[obj+0xa8]` ND 环门 + color_dims 扇出
```c
// BuildStrategy @ 0x137c4660
if (*((_BYTE *)this + 168) == 1) { // [obj+0xa8] == 1 ⇒ ND-ring path
*((_QWORD *)this + 185) = 1; // [obj+0x5c8] = 1 unit stride for dim0
--*((_QWORD *)this + 2); // [obj+0x10] num-active-dims adjust
// per-color memmove fan-out: shift each color row's dim array by one slot.
// rows are at [obj + {0xd0/0xd8, 0xe8/0xf0, 0x100/0x108, 0x118/0x120, 0x130/0x138, 0x148/0x150}]
int64_t v5 = *((_QWORD *)this + 2); // dim count; v7 = 8 * v5 (bytes)
memmove((char*)this + 208, (char*)this + 216, v7); // row 0 (0xd0 <- 0xd8)
if (num_colors != 1) memmove((char*)this + 232, (char*)this + 240, v7); // row 1
if (num_colors != 2) memmove((char*)this + 256, (char*)this + 264, v7); // row 2
if (num_colors != 3) memmove((char*)this + 280, (char*)this + 288, v7); // row 3
if (num_colors != 4) memmove((char*)this + 304, (char*)this + 312, v7); // row 4
if (num_colors != 5) memmove((char*)this + 328, (char*)this + 336, v7); // row 5
if (num_colors != 6) __builtin_trap(); // ud1: >6 colors unreachable
}
// else [obj+0xa8] == 0: 1-D-ring path, no fan-out[obj+0xa8] 字节是 StrategyND ctor 的 p6 参数(UniDirectionNDRingStrategy 与 UniDirection1DRingStrategy 选择器;请参阅 SelectNDStrategy ctor表)。扇出将最多六个颜色行的维度阵列中的每一个移动一个插槽,在 num_colors != 1..6 上门控。
包裹标志负载
每轴 torus-wrap 标志来自 Target 内部的芯片配置:
// chip_config = Target[+0x3b8] (decompile: *((_QWORD*)v3 + 119))
int64_t cfg = *((_QWORD *)Target + 119);
v9 = *(uint16_t *)(cfg + 160); // chip_cfg+0xa0
wrapX = v9 & 1; // → v102
wrapY = *(_BYTE *)(cfg + 161) & 1; // chip_cfg+0xa1 → v101
wrapZ = *(_BYTE *)(cfg + 162) & 1; // chip_cfg+0xa2 → v103
```text
这三个字节(`chip_cfg+0xa0/+0xa1/+0xa2`)是X/Y/Z每轴环面包裹标志;他们在 `ComputeNeighbor` 中的每个维度选择圆环(包裹环)与网格(开环)。相邻字节 `chip_cfg+0xa3` 是扭曲环面路径使用的扭曲/环面包裹使能门(请参见 [扭曲环面概述](../twist/overview.md))。
### 每颜色 `RingLocation` 坐标构建
`net_util::RingLocation` 是三个 `long` (24 B)。每个颜色的数组从 `[obj+0x18]` 开始,跨度为 `0x18`。对于每种颜色,对于每个活动暗淡 `d`,坐标为 `extent · stride / divisor`:
```text
RingLocation = { coord[0], coord[1], coord[2] } // 24 B, stride 0x18 per color
for color in [0 .. num_colors([obj+0x8]) - 1]:
for d in [0 .. num_dims([obj+0x10]) - 1]:
dim_idx = color_dims[color][d] // long[r13 + 0xb8 + d*8], bounds < 3
extent = long[obj + 0xb8 + dim_idx*8]
stride = long[obj + 0x5c8 + d*8] // d=0:0x5c8, d=1:0x5d0, d=2:0x5d8
divisor = long[obj + 0x5b0 + dim_idx*8]
coord[d] = (extent * stride) / divisor // 32-bit unsigned div fast path
store coord[d] → long[r13 + d*8]反编译确认循环体中的三个除法存储 — *v19 = (unsigned int)v23 / (unsigned int)v24、v19[1] = … / …、v19[2] = … / … — 写入三个 RingLocation 长整型。这里消耗的color_dims[6][3]表是生成的ComputeColorDimensions(正常)或InitColorDimensionsDegraded(降级); 在退化情况下,每行的列 [2] 都是死轴,因此为列 [0]/[1] 进行环形行走的种子坐标只是两个健康轴。
邻居调度
然后将每个颜色/暗淡坐标转换为环序数和前/后邻居:
StrategyND::ComputeOrdinal(0x137c5300) — 坐标 → 环序号LloValue;每个(颜色,活动暗淡)调用一次。反编译显示三个 per-dim 调用 (dimarg0/1/2) 传递 per-dim 换行字节*(&v101 + …)。StrategyND::ComputeNeighbor(0x137c5600) — 每个(颜色、活动暗淡)调用两次:偏移+1(顺时针)和-1(逆时针)。反编译确认了六个调用(dims0/1/2,每个调用都有1和-1)。调度读取logical_devices = *(_QWORD*)(strat + 8*dim + 1480)和每暗度度字节*(strat + 24*color + 8*dim + 208),然后在每暗度wrap字节(arga6,从BuildStrategy线程化的*(&v101 + dim_idx)值)和(logical_devices≥2 && dim==0)“特殊”谓词之一上进行分支四个建设者。非特殊路径CHECKslogical_devices == 1(.rodata、target_factory/all_reduce_strategies.cc:314,322):
wrap | special(logical_devices≥2&dim0) | logical_devices==1 | 生成器 |
|---|---|---|---|
| 1 | 是 | — | Torus2DevicePhase0Neighbor |
| 0 | 是 | — | Mesh2DevicePhase0Neighbor |
| 1 | no | 是 | TorusStrideNPhasekNeighbor |
| 0 | no | 是 | MeshStrideNPhasekNeighbor |
所有四个都通过 BaseStrategyND::UpdateNeighborLocation (0x137c5fa0) 存入每颜色顺时针/逆时针相邻缓冲区。结果是,每个颜色和每个活动环面暗淡,两个环邻居(向前/向后)构建为来自 RingLocation 坐标的环面(包裹)或网格(开放)跳跃 - 物理集体环。填充的 StrategyND 变为 UniDirectionNDRingStrategy(构造函数 0x137d4700),或者在一维路径上变为 UniDirection1DRingStrategy(构造函数 0x137d4a20)。
注意 - 置信度中等(与邻居调度的交互退化)。 退化的折叠在
color_dims级别(死轴 → 列[2])得到充分证明,并且坐标构建逐字消耗该表。每个颜色的发射器行走(确切地说哪个环步以重新排序的表下的哪个邻居为目标)是 二项式/递归加倍 上记录的递归加倍伙伴计划;这里只转录上面的调度表和调用结构。
摄取链摘要
| 舞台 | 符号@VMA | 数据表/字段 |
|---|---|---|
| 1 检测 | SliceBuilderHelper::StatSession @ 0x1fbb5b80 | vector<Orientation>(错误链接) |
| 2 地图 | OrientationsToTpuDegradedAxes @ 0x1fc57d00 | 枚举 1/2/3 → x/y/z 字节 |
| 3 件装 | StatSession尾部 | 双字 x | y<<8 | z<<16 | w<<24 |
| 4线 | TpuDegradedAxesProto{x,y,z} | 标签 0x08/0x10/0x18;字节 +0x18..+0x1a |
| 5进位 | tpu::TpuConfiguredProperties(8字节POD) | +0 x、+1 y、+2 z、+3 nhop、+4 routing |
| 6 写入 | target::CreateFromTopology @ 0x1d48e520 | → Target[+0x3f8..+0x3fc] |
| 7 使用 | GetDegradedAxis @ 0x1c894c20 (SelectND策略) | → 弹性2轴ND环 |
| 8 构建 | StrategyND::BuildStrategy @ 0x137c4660 | 每色 RingLocation 环走 |
功能图
| 功能 | 地址 | 角色 |
|---|---|---|
tpu::OrientationsToTpuDegradedAxes | 0x1fc57d00 | 枚举 1/2/3 → x/y/z 降级字节 |
SliceBuilderHelper::StatSession | 0x1fbb5b80 | 链路故障 Orientation 源;打包双字 |
TpuDegradedAxesProto::_InternalSerialize | 0x20adb880 | 原始字节布局证明 |
tpu::GetDefaultConfiguredProperties | 0x20acee40 | 无降级默认 POD |
target::CreateFromTopology (…,TpuConfiguredProperties&,…) | 0x1d48e520 | 作者:cfg → Target[+0x3f8..+0x3fc] |
target::CreateFromTopology (…,MultiSliceTopologyAndLocation*) | 0x1d48e4c0 | 默认配置包装器(由 GetTargetDescription 调用) |
target::CreateFromTopology (TpuTopology*,long) | 0x1d48e460 | 默认配置包装器(由 CreateTargetFromDeepseaPlatform 调用) |
Target::IsXDegraded / IsYDegraded / IsZDegraded | 0x1d615940 / …960 / …980 | 读取 Target[+0x3f8..+0x3fa] |
StrategyND::BuildStrategy | 0x137c4660 | [obj+0xa8] 门,color_dims 扇出,RingLocation 构建 |
StrategyND::ComputeOrdinal | 0x137c5300 | 坐标 → 环序号 LloValue |
StrategyND::ComputeNeighbor | 0x137c5600 | 前向/后向邻居,4 建造者调度 |
BaseStrategyND::UpdateNeighborLocation | 0x137c5fa0 | 将邻居存入环表 |
UniDirectionNDRingStrategy::ctor / UniDirection1DRingStrategy::ctor | 0x137d4700 / 0x137d4a20 | 薄型 ND/1-D 环形包装纸 |
未解决的问题
- 方向枚举
4/5/6。OrientationsToTpuDegradedAxes仅折叠1/2/3;尚未确认4/5/6是否是应折叠到同一轴字节的负轴方向(-X/-Y/-Z)或不同的含义。低的。 - **
is_nhop_source_relative消费者。**第4个POD字节(cfg[+3]→Target[+0x3fb])写在这里;没有追踪到它在 ICI 路由表/环向层中的影响。仅GetDefaultConfiguredProperties设置= (routing_strategy == 2)已被证明。低的。 - 每颜色发射器在退化下行走。
color_dims重新排序(死轴→内柱)和坐标构建为高;发射器在重新排序的表上行走的确切递归加倍伙伴序列归 二项式/递归加倍 所有。中等的。 - 上游负轴归因。 哪个切片发现路径发出
vector<Orientation>以及链接极性如何映射到单个轴位于 ICI 层中 — 请参阅 ICI 故障模式和恢复。这里没有解码。
交叉引用
- SelectNDStrategy — ND 集体算法选择器 — 消费者端:
GetDegradedAxis、InitColorDimensionsDegraded、UseResilientAlgorithmBase、[6][3]重映射和GetResourceFromIciResource插槽映射 - 集体概述 — 降级路径位于吊舱集体降低位置
- SPMD 链路计数成本 — 降级轴的两个 ICI 插槽如何离开主环(
num_dims除数3 → 2) - 二项式/递归加倍 — 每个等级的合作伙伴计划构建的环运行
- 扭曲环面概述 和 TwistedTorusND::BuildStrategy — 在同一降级记录上门控的弹性扭曲变体
- ICI 故障模式和恢复 — 产生故障链路方向的上游链路故障检测