mx-qual 用户手册

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

命令格式:mx-qual [选项] 子命令

-h,--help

显示帮助信息。

-v,--version

显示 mx-qual 的版本。

子命令 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:      2515040220002
  PCI Bus ID:         0000:26:00.0
  Runtime version:    3.12.0
  Driver version:     3.13.0
  Firmware version:   1.0.17

输出字段

Serial number

PCI Bus ID

Runtime version

Driver version

Firmware version

说明

设备序列号

PCI 总线 ID

运行时版本

驱动版本

固件版本

子命令 pcie_bandwidth

运行 PCIe 带宽测试。

mx-qual pcie_bandwidth [选项]

-h,--help

显示帮助信息。

-i, --index

指定设备索引。取值范围:0-31。如果未指定,则测试所有设备;如果指定多个值:

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

  • 花括号中逗号分隔,例如:-i {0,1,2}

-s,--sn

指定板卡的序列号。通过 mx-smi 命令可查看板卡序列号,具体请参见 mx-smi 用户手册

须知

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

-d,--data_size

指定测试的数据大小。取值范围:32-100 MB,默认值:100 MB。

-l,--loop

指定测试的循环次数。取值范围:1-100 次,默认值:1 次。

-f,--full_duplex

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

示例

以下示例测试指定设备的 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
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

指定板卡的序列号。通过 mx-smi 命令可查看板卡序列号,具体请参见 mx-smi 用户手册

须知

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

-d,--data_size

指定测试的数据大小。取值范围:32-100 MB,默认值:100 MB。

-l,--loop

指定测试的循环次数。取值范围:1-100 次,默认值:1 次。

示例

以下示例测试指定设备的内存带宽(以 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,至少指定两个设备才能运行 P2P 测试。如果指定多个值:

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

  • 花括号中逗号分隔,例如:-i {0,1,2}

-c,--card

指定板卡索引。取值范围:0-31,至少指定两张板卡才能运行 P2P 测试。如果指定多个值:

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

  • 花括号中逗号分隔,例如:-c {0,1,2}

须知

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

示例

以下示例测试指定设备的 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.log 文件,记录详细数据。测试结束后,输出汇总信息。

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 -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

util.avg

说明

当前温度

当前平均温度

当前功率

当前平均功率

当前利用率

当前平均利用率

总览信息:

输出字段

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: 2515040220002, actual:  116.66 TOPS, target:  117.96 TOPS, Utilization: 98.90%
    SN: 2515040220003, actual:  116.68 TOPS, target:  117.96 TOPS, Utilization: 98.91%
    SN: 2515040220004, actual:  116.65 TOPS, target:  117.96 TOPS, Utilization: 98.89%
    SN: 2520040220005, actual:  116.65 TOPS, target:  117.96 TOPS, Utilization: 98.89%
  2x sparsity:
    SN: 2515040220002, actual:  231.09 TOPS, target:  235.93 TOPS, Utilization: 97.95%
    SN: 2515040220003, actual:  231.04 TOPS, target:  235.93 TOPS, Utilization: 97.93%
    SN: 2515040220004, actual:  231.04 TOPS, target:  235.93 TOPS, Utilization: 97.93%
    SN: 2520040220005, actual:  231.14 TOPS, target:  235.93 TOPS, Utilization: 97.97%
  4x sparsity:
    SN: 2515040220002, actual:  462.59 TOPS, target:  471.86 TOPS, Utilization: 98.04%
    SN: 2515040220003, actual:  461.78 TOPS, target:  471.86 TOPS, Utilization: 97.86%
    SN: 2515040220004, actual:  461.78 TOPS, target:  471.86 TOPS, Utilization: 97.86%
    SN: 2520040220005, actual:  461.98 TOPS, target:  471.86 TOPS, Utilization: 97.91%
  8x sparsity:
    SN: 2515040220002, actual:  927.61 TOPS, target:  943.72 TOPS, Utilization: 98.29%
    SN: 2515040220003, actual:  927.61 TOPS, target:  943.72 TOPS, Utilization: 98.29%
    SN: 2515040220004, actual:  928.42 TOPS, target:  943.72 TOPS, Utilization: 98.38%
    SN: 2520040220005, actual:  928.42 TOPS, target:  943.72 TOPS, Utilization: 98.38%
  16x sparsity:
    SN: 2515040220002, actual: 1837.54 TOPS, target: 1887.44 TOPS, Utilization: 97.36%
    SN: 2515040220003, actual: 1831.22 TOPS, target: 1887.44 TOPS, Utilization: 97.02%
    SN: 2515040220004, actual: 1831.22 TOPS, target: 1887.44 TOPS, Utilization: 97.02%
    SN: 2520040220005, actual: 1828.06 TOPS, target: 1887.44 TOPS, Utilization: 96.85%
  32x sparsity:
    SN: 2515040220002, actual: 3558.22 TOPS, target: 3774.87 TOPS, Utilization: 94.26%
    SN: 2515040220003, actual: 3546.18 TOPS, target: 3774.87 TOPS, Utilization: 93.94%
    SN: 2515040220004, actual: 3570.25 TOPS, target: 3774.87 TOPS, Utilization: 94.58%
    SN: 2520040220005, actual: 3546.18 TOPS, target: 3774.87 TOPS, Utilization: 93.94%
BF16
  1x sparsity:
    SN: 2515040220002, actual:   58.35 TFLOPS, target:   58.98 TFLOPS, Utilization: 98.92%
    SN: 2515040220003, actual:   58.34 TFLOPS, target:   58.98 TFLOPS, Utilization: 98.91%
    SN: 2515040220004, actual:   58.35 TFLOPS, target:   58.98 TFLOPS, Utilization: 98.94%
    SN: 2520040220005, actual:   58.34 TFLOPS, target:   58.98 TFLOPS, Utilization: 98.91%
  2x sparsity:
    SN: 2515040220002, actual:  115.47 TFLOPS, target:  117.96 TFLOPS, Utilization: 97.89%
    SN: 2515040220003, actual:  115.47 TFLOPS, target:  117.96 TFLOPS, Utilization: 97.89%
    SN: 2515040220004, actual:  115.44 TFLOPS, target:  117.96 TFLOPS, Utilization: 97.86%
    SN: 2520040220005, actual:  115.47 TFLOPS, target:  117.96 TFLOPS, Utilization: 97.89%
  4x sparsity:
    SN: 2515040220002, actual:  232.00 TFLOPS, target:  235.93 TFLOPS, Utilization: 98.34%
    SN: 2515040220003, actual:  231.95 TFLOPS, target:  235.93 TFLOPS, Utilization: 98.31%
    SN: 2515040220004, actual:  231.90 TFLOPS, target:  235.93 TFLOPS, Utilization: 98.29%
    SN: 2520040220005, actual:  232.10 TFLOPS, target:  235.93 TFLOPS, Utilization: 98.38%
  8x sparsity:
    SN: 2515040220002, actual:  464.01 TFLOPS, target:  471.86 TFLOPS, Utilization: 98.34%
    SN: 2515040220003, actual:  464.21 TFLOPS, target:  471.86 TFLOPS, Utilization: 98.38%
    SN: 2515040220004, actual:  464.01 TFLOPS, target:  471.86 TFLOPS, Utilization: 98.34%
    SN: 2520040220005, actual:  464.21 TFLOPS, target:  471.86 TFLOPS, Utilization: 98.38%
  16x sparsity:
    SN: 2515040220002, actual:  926.80 TFLOPS, target:  943.72 TFLOPS, Utilization: 98.21%
    SN: 2515040220003, actual:  928.42 TFLOPS, target:  943.72 TFLOPS, Utilization: 98.38%
    SN: 2515040220004, actual:  929.23 TFLOPS, target:  943.72 TFLOPS, Utilization: 98.46%
    SN: 2520040220005, actual:  927.61 TFLOPS, target:  943.72 TFLOPS, Utilization: 98.29%
  32x sparsity:
    SN: 2515040220002, actual: 1831.22 TFLOPS, target: 1887.44 TFLOPS, Utilization: 97.02%
    SN: 2515040220003, actual: 1834.38 TFLOPS, target: 1887.44 TFLOPS, Utilization: 97.19%
    SN: 2515040220004, actual: 1834.38 TFLOPS, target: 1887.44 TFLOPS, Utilization: 97.19%
    SN: 2520040220005, actual: 1831.22 TFLOPS, target: 1887.44 TFLOPS, Utilization: 97.02%
FP16
  1x sparsity:
    SN: 2515040220002, actual:   58.34 TFLOPS, target:   58.98 TFLOPS, Utilization: 98.91%
    SN: 2515040220003, actual:   58.35 TFLOPS, target:   58.98 TFLOPS, Utilization: 98.92%
    SN: 2515040220004, actual:   58.34 TFLOPS, target:   58.98 TFLOPS, Utilization: 98.91%
    SN: 2520040220005, actual:   58.34 TFLOPS, target:   58.98 TFLOPS, Utilization: 98.91%
  2x sparsity:
    SN: 2515040220002, actual:  115.46 TFLOPS, target:  117.96 TFLOPS, Utilization: 97.87%
    SN: 2515040220003, actual:  115.50 TFLOPS, target:  117.96 TFLOPS, Utilization: 97.91%
    SN: 2515040220004, actual:  115.41 TFLOPS, target:  117.96 TFLOPS, Utilization: 97.83%
    SN: 2520040220005, actual:  115.44 TFLOPS, target:  117.96 TFLOPS, Utilization: 97.86%
  4x sparsity:
    SN: 2515040220002, actual:  231.95 TFLOPS, target:  235.93 TFLOPS, Utilization: 98.31%
    SN: 2515040220003, actual:  232.05 TFLOPS, target:  235.93 TFLOPS, Utilization: 98.36%
    SN: 2515040220004, actual:  232.10 TFLOPS, target:  235.93 TFLOPS, Utilization: 98.38%
    SN: 2520040220005, actual:  232.05 TFLOPS, target:  235.93 TFLOPS, Utilization: 98.36%
  8x sparsity:
    SN: 2515040220002, actual:  464.01 TFLOPS, target:  471.86 TFLOPS, Utilization: 98.34%
    SN: 2515040220003, actual:  464.01 TFLOPS, target:  471.86 TFLOPS, Utilization: 98.34%
    SN: 2515040220004, actual:  464.21 TFLOPS, target:  471.86 TFLOPS, Utilization: 98.38%
    SN: 2520040220005, actual:  464.21 TFLOPS, target:  471.86 TFLOPS, Utilization: 98.38%
  16x sparsity:
    SN: 2515040220002, actual:  928.42 TFLOPS, target:  943.72 TFLOPS, Utilization: 98.38%
    SN: 2515040220003, actual:  928.42 TFLOPS, target:  943.72 TFLOPS, Utilization: 98.38%
    SN: 2515040220004, actual:  928.42 TFLOPS, target:  943.72 TFLOPS, Utilization: 98.38%
    SN: 2520040220005, actual:  927.61 TFLOPS, target:  943.72 TFLOPS, Utilization: 98.29%
  32x sparsity:
    SN: 2515040220002, actual: 1840.70 TFLOPS, target: 1887.44 TFLOPS, Utilization: 97.52%
    SN: 2515040220003, actual: 1831.22 TFLOPS, target: 1887.44 TFLOPS, Utilization: 97.02%
    SN: 2515040220004, actual: 1834.38 TFLOPS, target: 1887.44 TFLOPS, Utilization: 97.19%
    SN: 2520040220005, actual: 1831.22 TFLOPS, target: 1887.44 TFLOPS, Utilization: 97.02%

Test Result = PASS

子命令 memtest

运行内存测试。

mx-qual memtest [选项]

-h,--help

显示帮助信息。

-i, --index

指定设备索引。取值范围:0-31。如果未指定,则测试所有设备;如果指定多个值:

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

  • 花括号中逗号分隔,例如:-i {0,1,2}

-l,--loop

指定测试的循环次数。取值范围:1-100 次,默认值:1 次。

-t,--type

指定测试的类型。取值:0-10,默认值:7。详细含义请参见 MemTest86 技术信息

测试类型值

说明

type 0

Walking 1 bit

type 1

Own address test

type 2

Moving inversions, ones&zeros

type 3

Moving inversions, 8 bit pat

type 4

Moving inversions, random pattern

type 5

Block move, 64 moves

type 6

Moving inversions, 32 bit pat

type 7

Random number sequence

type 8

Modulo 20, random pattern

type 9

Bit fade test

type 10

Memory stress test

示例

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。

示例

  1. 查询 PCIe switch 信息。

    lspci -D | grep PMC | grep Memory | grep 4068
    
    0000:81:00.1 Memory controller: PMC-Sierra Inc. Device 4068
    
  2. 查看指定 PCIe 通道的眼图。

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