mx-qual 用户手册

mx-qual(MOFFETT Qualification)是基于 SOLA Runtime API 构建的设备质量测试工具,用于检测墨芯 SPU 设备的可用性、稳定性及性能等多项关键指标。

基本使用

用法概览

mx-qual [选项] 子命令

常规选项

  • -h,--help:显示帮助信息。

  • --version:显示工具的版本信息。

子命令详解

子命令 list

功能

列出指定的设备信息。

用法

mx-qual list [选项]

选项

  • -h,--help:显示帮助信息。

  • -i, --index:指定设备索引。如果未指定,则默认列出所有设备信息。

    • 取值范围:0-31。

    • 使用方式:

      • 空格分隔多个值,例如:-i 0 1 2

      • 使用花括号列表,例如:-i {0,1,2}

示例

以下示例列出指定设备的信息:

mx-qual list -i 0
Device 0: "S40-02-A02"
  Serial number:      2515040220003
  PCI Bus ID:         0000:38:00.0
  Runtime version:    3.11.0
  Driver version:     3.11.0
  Firmware version:   1.0.17

输出字段说明

字段 说明
Serial number 设备序列号。
PCI Bus ID PCI 总线 ID
Runtime version 运行时版本
Driver version 驱动版本
Firmware version 固件版本

子命令 pcie_bandwidth

功能

运行 PCIe 带宽测试。

用法

mx-qual pcie_bandwidth [选项]

选项

  • -h,--help:显示帮助信息。

  • -i, --index:指定设备索引。如果未指定,则默认测试所有设备。

    • 取值范围:0-31。

    • 使用方式:

      • 空格分隔多个值,例如:-i 0 1 2

      • 使用花括号列表,例如:-i {0,1,2}

  • -s,--sn:指定板卡的序列号。

  • -d,--data_size:指定测试的数据大小。

    • 取值范围:32-100 MB。

    • 默认值:100 MB。

  • -l,--loop:指定测试的循环次数。

    • 取值范围:1-100 次。

    • 默认值:1 次。

  • -f,--full_duplex:启用全双工测试。如果未指定该选项,则默认运行半双工测试。

说明

  • -s 的优先级比 -i 高。如果同时指定了 -i-s,则只测试 -s 指定的设备。

  • 使用 mx-smi 命令可查看板卡序列号,具体操作请参见 mx-smi 用户手册.

示例

以下示例测试指定设备的 PCIe 带宽(以 S30/S4 为例):

mx-qual pcie_bandwidth -i 0
PCIe Bandwidth Test (half duplex mode)
Device id: [0]

Host to Device Bandwidth
Transfer Size: 100.000 MB, Bandwidth: 12.298 GB/s

Device to Host Bandwidth
Transfer Size: 100.000 MB, Bandwidth: 12.358 GB/s

Test Result = PASS

以下示例启用全双工测试,并测试 10 次(以 S40 卡为例):

mx-qual pcie_bandwidth -f -l 10 -d 60 -i 
PCIe Bandwidth Test (full duplex mode)
 Device id: [0, 1, 2, 3, 4, 5, 6, 7]

 Host to Device Bandwidth
 Transfer Size: 4800.000 MB, Bandwidth: 28.411 GB/s

 Device to Host Bandwidth
 Transfer Size: 4800.000 MB, Bandwidth: 28.421 GB/s

输出字段说明

字段 说明
Transfer Size 传输数据大小(MB)
Bandwidth 带宽

说明

如果指定了多个设备进行多次测试,则 Transfer Size 显示的为所有指定设备在多次测试中累积的数据大小,其他命令同理。

子命令 memory_bandwidth

功能

运行设备内存带宽测试。

用法

mx-qual memory_bandwidth [选项]

选项

  • -h,--help:显示帮助信息。

  • -i, --index:指定设备索引。如果未指定,则默认测试所有设备。

    • 取值范围:0-31。

    • 使用方式:

      • 空格分隔多个值,例如:-i 0 1 2

      • 使用花括号列表,例如:-i {0,1,2}

  • -s,--sn:指定板卡的序列号。

  • -d,--data_size:指定测试的数据大小。

    • 取值范围:32-100 MB。

    • 默认值:100 MB。

  • -l,--loop:指定测试的循环次数。

    • 取值范围:1-100 次。

    • 默认值:1 次。

说明

  • -s的优先级比-i高。如果同时指定了 -i-s,则只测试 -s 指定的设备。

  • 使用 mx-smi 命令可查看板卡序列号,具体操作请参见 mx-smi 用户手册

示例

以下示例测试指定设备的内存带宽(以 S30/S4 为例):

mx-qual memory_bandwidth -i 0
Memory Bandwidth Test
 Device id: [0]

 Memory Read  Bandwidth
 Transfer Size: 100.000 MB, Bandwidth: 60.872 GB/s

 Memory Write Bandwidth
 Transfer Size: 100.000 MB, Bandwidth: 61.158 GB/s

Test Result = PASS

以下示例测试对指定设备测试 10 次,并指定传输数据的大小为 32 MB(以两张 S40 卡为例):

mx-qual memory_bandwidth -i 0 -d 32 -l 10
Memory Bandwidth Test
 Device id: [0]

 Memory Read  Bandwidth
 Transfer Size: 320.000 MB, Bandwidth: 49.944 GB/s

 Memory Write Bandwidth
 Transfer Size: 320.000 MB, Bandwidth: 50.440 GB/s

Test Result = PASS

输出字段说明

字段 说明
Transfer Size 传输数据大小(MB)
Bandwidth 带宽

子命令 P2P

功能

运行 P2P(Peer to Peer)带宽测试。

用法

mx-qual p2p [选项]

选项

  • -h,--help:显示帮助信息。

  • -d,--device:指定设备索引。如果未指定,则默认测试所有设备。

    • 取值范围:0-31。

    • 使用方式:

      • 空格分隔多个值,例如:-d 0 1 2

      • 使用花括号列表,例如:-d {0,1,2}

  • -c,--card:指定板卡索引。

    • 取值范围:0-31。

    • 使用方式:

      • 空格分隔多个值,例如:-c 0 1 2

      • 使用花括号列表,例如:-c {0,1,2}

说明

-c 的优先级比 -d 高。如果同时指定了 -c-d,则只测试 -c 指定的设备。

示例

以下示例测试指定设备的 P2P 带宽(以 S30 为例):

mx-qual p2p -d 0 1 2
P2P Connectivity Matrix
    D/D      0      1      2
    0        0      1      1
    1        1      0      1
    2        1      1      0

Unidirectional P2P Bandwidth Matrix (GB/s)
    D/D      0      1      2
    0     0.00  10.78  10.99
    1    10.83   0.00  11.03
    2    10.98  10.97   0.00

Bidirectional P2P Bandwidth Matrix (GB/s)
    D/D      0      1      2
    0     0.00  21.96  21.67
    1    21.96   0.00  21.71
    2    21.67  21.71   0.00

P2P Latency Matrix (ms)
    SPU      0      1      2
    0     0.00   3.11   3.05
    1     3.10   0.00   3.04
    2     3.06   3.06   0.00

    CPU      0      1      2
    0     0.00   8.79   8.81
    1     8.73   0.00   8.66
    2     8.74   8.91   0.00

Test Result = PASS

以下示例测试指定板卡的 P2P 带宽(以 S30 为例):

mx-qual p2p -c 0 1
P2P Connectivity Matrix
    C/C      0      1
    0        0      1
    1        1      0

Unidirectional P2P Bandwidth Matrix (GB/s)
    C/C      0      1
    0     0.00  27.55
    1    27.60   0.00

Bidirectional P2P Bandwidth Matrix (GB/s)
    C/C      0      1
    0     0.00  55.15
    1    55.15   0.00

P2P Latency Matrix (ms)
    SPU      0      1
    0     0.00   3.65
    1     3.65   0.00

    CPU      0      1
    0     0.00  11.11
    1    11.10   0.00

Test Result = PASS

输出字段说明

字段 说明
P2P Connectivity Matrix 设备或板卡间是否存在点对点连接。0 - 无连接,1 - 存在连接
Unidirectional P2P Bandwidth Matrix (GB/s) 设备或板卡间单向数据传输速率(单位:GB/s)
Bidirectional P2P Bandwidth Matrix (GB/s) 设备或板卡间双向数据传输速率(单位:GB/s)
P2P Latency Matrix (ms) SPU 和 CPU 点对点通信延迟(单位:ms)

说明

D/D = Device/Device,C/C = Card/Card

子命令 stress

功能

运行压力测试,可以对设备的内存和计算单元进行测试。

用法

mx-qual stress [选项]

选项

  • -h,--help:显示帮助信息。

  • -i, --index:指定设备索引。如果未指定,则默认测试所有设备。

    • 取值范围:0-31。

    • 使用方式:

      • 空格分隔多个值,例如:-i 0 1 2

      • 使用花括号列表,例如:-i {0,1,2}

  • -t,--time:指定循环测试一次的时间。

    • 取值范围:2-100000 分钟。

    • 默认值:2 分钟。

  • -l,--load:指定压力测试的负载。

    • 取值范围:0-100%。

    • 默认值:100%。

说明

系统在启动后预热一分钟,此期间不监控设备状态。预热结束后,每秒采集温度、功率和利用率,并实时更新。系统会生成 mx-qual-stress.log 日志,记录测试数据。测试结束后,输出汇总信息。

示例

以下示例对指定设备进行压力测试:

mx-qual stress -i 0 1 2
device  temp.cur  temp.avg  power.cur  power.avg  util.cur  util.avg    
0       68        68        65         66         99        99        
1       67        66        65         65         99        100       
2       69        68        67         66         99        99        


===================================================================================================
Summary
===================================================================================================
device  temp.min  temp.max  temp.avg  power.min  power.max  power.avg  util.min  util.max  util.avg
0       66        68        68        65         68         66         99        99        99       
1       65        67        66        63         67         65         99        100       100      
2       67        69        68        65         68         66         99        99        99       

Test Result = PASS

输出字段说明

字段 说明
temp.cur 当前温度
temp.avg 当前温度
power.cur 当前功率
power.avg 平均功率
util.cur 当前利用率
temp.min 最低温度
temp.max 最高温度
temp.avg 平均温度
power.min 最小功率
power.max 最大功率
power.avg 平均功率
util.min 最小利用率
util.max 最大利用率
util.avg 平均利用率

子命令 compute

功能

运行算力测试。

用法

mx-qual compute [选项]

选项

  • -h,--help:显示帮助信息。

  • -i, --index:指定设备索引。如果未指定,则默认测试所有设备。

    • 取值范围:0-31。

    • 使用方式:

      • 空格分隔多个值,例如:-i 0 1 2

      • 使用花括号列表,例如:-i {0,1,2}

说明

测试结果以板卡为单位进行展示,并包含在不同稀疏倍率下的性能数据。

示例

以下示例对所有设备运行算力测试:

mx-qual compute 
 INT8
  1x sparsity:
    SN: 2023243080074, actual:   87.64 TOPS, target:   88.47 TOPS, Utilization: 99.06%
    SN: 2023243080096, actual:   87.64 TOPS, target:   88.47 TOPS, Utilization: 99.06%
  2x sparsity:
    SN: 2023243080074, actual:  173.77 TOPS, target:  176.95 TOPS, Utilization: 98.21%
    SN: 2023243080096, actual:  173.62 TOPS, target:  176.95 TOPS, Utilization: 98.12%
  4x sparsity:
    SN: 2023243080074, actual:  347.35 TOPS, target:  353.89 TOPS, Utilization: 98.15%
    SN: 2023243080096, actual:  347.55 TOPS, target:  353.89 TOPS, Utilization: 98.21%
  8x sparsity:
    SN: 2023243080074, actual:  695.91 TOPS, target:  707.79 TOPS, Utilization: 98.32%
    SN: 2023243080096, actual:  695.91 TOPS, target:  707.79 TOPS, Utilization: 98.32%
  16x sparsity:
    SN: 2023243080074, actual: 1377.36 TOPS, target: 1415.58 TOPS, Utilization: 97.30%
    SN: 2023243080096, actual: 1374.20 TOPS, target: 1415.58 TOPS, Utilization: 97.08%
  32x sparsity:
    SN: 2023243080074, actual: 2662.64 TOPS, target: 2831.16 TOPS, Utilization: 94.05%
    SN: 2023243080096, actual: 2662.64 TOPS, target: 2831.16 TOPS, Utilization: 94.05%
BF16
  1x sparsity:
    SN: 2023243080074, actual:   43.82 TOPS, target:   44.24 TOPS, Utilization: 99.05%
    SN: 2023243080096, actual:   43.82 TOPS, target:   44.24 TOPS, Utilization: 99.05%
  2x sparsity:
    SN: 2023243080074, actual:   86.77 TOPS, target:   88.47 TOPS, Utilization: 98.08%
    SN: 2023243080096, actual:   86.80 TOPS, target:   88.47 TOPS, Utilization: 98.11%
  4x sparsity:
    SN: 2023243080074, actual:  174.13 TOPS, target:  176.95 TOPS, Utilization: 98.41%
    SN: 2023243080096, actual:  174.23 TOPS, target:  176.95 TOPS, Utilization: 98.46%
  8x sparsity:
    SN: 2023243080074, actual:  348.76 TOPS, target:  353.89 TOPS, Utilization: 98.55%
    SN: 2023243080096, actual:  348.76 TOPS, target:  353.89 TOPS, Utilization: 98.55%
  16x sparsity:
    SN: 2023243080074, actual:  698.35 TOPS, target:  707.79 TOPS, Utilization: 98.67%
    SN: 2023243080096, actual:  698.35 TOPS, target:  707.79 TOPS, Utilization: 98.67%
  32x sparsity:
    SN: 2023243080074, actual: 1371.04 TOPS, target: 1415.58 TOPS, Utilization: 96.85%
    SN: 2023243080096, actual: 1374.20 TOPS, target: 1415.58 TOPS, Utilization: 97.08%
   Test Result = PASS

子命令 memtest

功能

运行内存测试。

用法

mx-qual memtest [选项]

选项

  • -h,--help:显示帮助信息。

  • -i, --index:指定设备索引。如果未指定,则默认测试所有设备。

    • 取值范围:0-31。

    • 使用方式:

      • 空格分隔多个值,例如:-i 0 1 2

      • 使用花括号列表,例如:-i {0,1,2}

  • -t,--type:指定测试的类型。

    • 取值范围:0-10。每个值对应的测试类型如下表所示。

    • 默认值:7。

  • -l,--loop:指定测试的循环次数。

    • 取值范围:1-100 次。

    • 默认值:1 次。

测试类型值 说明
0 Walking 1 bit
1 Own address test
2 Moving inversions, ones&zeros
3 Moving inversions, 8 bit pat
4 Moving inversions, random pattern
5 Block move, 64 moves
6 Moving inversions, 32 bit pat
7 Random number sequence
8 Modulo 20, random pattern
9 Bit fade test
10 Memory stress test

关于测试类型的具体含义,请参见 MemTest86 技术信息

示例

以下示例对指定设备进行类型 0 的测试。

mx-qual memtest -i 0 -t 0
Device[0] running test 4 / 4 ... passed
Test Result = PASS

子命令 eyegraph

功能

查看 PCIe 通道的眼图。

说明

仅支持 S30 计算卡。

用法

sudo mx-qual eyegraph [选项]

选项

  • -h,--help:显示帮助信息。

  • -s,--bdf:指定 PCIe 交换机(switch)的 BDF(bus:device:function)标识。

  • -l,--lane:指定 PCIe 交换机通道(lane)ID。

    • 取值范围:0-15。

    • 默认值:0。

说明

查看系统中可用的 PCIe 交换机,执行命令:lspci -D | grep PMC | grep Memory | grep 4068

示例

以下示例显示 lane ID 为 0 的眼图:

sudo mx-qual eyegraph -s 0000:01:00.1 -l 0