Bandwidth Test

Function

Measure the bus bandwidth and memory bandwidth.

Parameters

You can run either of the following commands to check the parameters of the bandwidth test command:

ascend-dmi --bw -h

ascend-dmi --bw --help

Table 1 lists only test-specific parameters. For details about other common parameters, see Common Parameters.

Table 1 Parameter description

Parameter

Description

Restriction

Mandatory

[-bw, --bw, --bandwidth]

Measures the bandwidth of the chip or entire card.

-

Yes

[-t, --type]

Specifies the data flows to be tested.

During bandwidth test, the test data flow can be divided into the following directions. If this parameter is not specified, the information about the bandwidth and total time consumption in the H2D, D2H, and D2D directions will be returned by default.
  • H2D: measures the bandwidth and total time consumption for data transmission from the host memory to the device memory through the PCIe bus. (When the bandwidth test is conducted on the Atlas A3 products, the total bandwidth and time consumption of the HCCS plane are tested.)
  • D2H: measures the bandwidth and total time consumption for data transmission from the device memory to the host memory through the PCIe bus. (When the bandwidth test is conducted on the Atlas A3 products, the total bandwidth and time consumption of the HCCS plane are tested.)
  • D2D: measures the bandwidth and total time consumption for data transmission from the device's DDR/on-chip memory to the device's chip register (mainly used to measure the device memory bandwidth).
  • P2P: measures the transmission rate and total time consumption from the source device to the destination device.
    NOTE:

    When P2P is used and the device is not specified (-ds and -dd are not specified), -s, -et, and -fmt do not take effect. The fixed-length mode and the corresponding default value are used. For example, in the ascend-dmi --bw -t p2p -fmt json command, -fmt does not take effect and the default value normal is used.

  • h2d_d2h: performs both H2D and D2H bandwidth tests.
  • For the Atlas 200I/500 A2 inference products, only the D2D mode is supported, and this parameter is not supported.
  • The P2P mode is supported only by the Atlas training products, Atlas A2 products, Atlas 300I Duo inference card, Atlas A3 products, and Ascend 950PR&950DT products.
  • For the Atlas 300I Duo inference card in P2P mode, -ds and -dd support only the device ID of the primary chip or the device IDs of the primary and secondary chips of the same card.
  • When the P2P test is performed between two 8-NPU groups on the Atlas 200T A2 Box16/Atlas 200I A2 Box16, only the P2P results of two equivalent positions can be output. For example, device 0 corresponds to device 8, and the P2P test result of device 0 to device 8 is output.
  • The h2d_d2h mode supports only the Atlas 350 accelerator card and Atlas 950 SuperPoD Flex.

No

[-m, --mode]

Specifies a bandwidth test mode, which can be a card- or device-level bandwidth test.

If this parameter is not specified, the device-level bandwidth test is performed by default.

  • device: logic ID of the Ascend NPU.
  • card: card ID of the Ascend NPU, which is used to test the bandwidth of the entire card.

This parameter is supported only when type is set to p2p for the Atlas A3 products.

No

[-s, --size]

Specifies the size of the data to be transmitted and the display mode of the test result.

  • The value range of the transmitted data is as follows:
    • Atlas A3 products: 1 byte to 4 GB in D2H, H2D, and P2P modes
    • Other products: 1 byte to 512 MB.
  • After -s is specified, a number must follow; otherwise, the format is incorrect.
    • -ds and -dd specified in H2D, D2H, D2D, and P2P modes
      • -s as the fixed-length mode
      • -s not as the step mode: 2 bytes to 32 MB
    • -ds and -dd not specified in P2P mode: In this scenario, -s does not take effect. The fixed-length mode and default value are used. The default values are described as follows:
      • For the Atlas A2 products and Atlas A3 products, the default size of the data to be transmitted from device 0 or 8 to other devices is 512 MB. In other cases, the default size is 256 MB.
      • For the Ascend 950PR&950DT products, the default size of data to be transmitted is 512 MB.
      • For other products, the default size of data to be transmitted is 128 MB.
  • For the Atlas A2 products, Atlas A3 products, and Ascend 950PR&950DT products, if -t is set to d2d, the size of the data to be transmitted is determined by the AI Core. As a result, -s is not supported.
  • For the Atlas 200I/500 A2 inference products, the size of the data to be transmitted is fixed at 0.97 GB (determined by the tensor), and this parameter is not supported.
  • When --duration is specified, the step mode is not supported. If the size is not specified, the default size of the data to be transmitted is 512 MB.

No

[-et, --et, --execute-times]

Specifies the number of iterations, that is, the number of copy times in the memory.

The value range is [1, 1000]. If this parameter is not specified, the number of copy times in step mode is 5 by default, and the number of copy times in fixed-length mode is 40 by default.

  • This parameter is not supported by the Atlas 200I/500 A2 inference products, Atlas A2 products, Atlas A3 products, and Ascend 950PR&950DT products in D2D mode. The default number of copy times is 1.
  • This parameter is not supported when --duration is specified.

No

[-d, --device]

Specifies the device ID where bandwidth test is to be performed. The device ID is the logic ID of the Ascend AI Processor.

If the device ID is set:

  • By default, the bandwidth information of the corresponding device ID is returned, and the ID field is displayed as the corresponding device ID.

If the device ID is not set:

  • For the Atlas A3 products, the full device bandwidth information is returned by default in D2H and H2D modes.
  • For other products, the bandwidth information of device 0 is returned by default.
  • To ensure that the Atlas 300I Duo inference card can deliver the optimal bandwidth test result, you are advised to test the bandwidth of device 0.
  • This parameter is not supported in P2P mode.
  • For the Ascend 950PR&950DT products, when type is set to h2d, d2h, or h2d_d2h, you can specify a single device ID or all available device IDs (that is, -d all).
  • -d all is not supported by the Atlas 650, Atlas 650E, Atlas 850, Atlas 850E and Atlas 950 SuperPoD.

No

[-ds, --ds, --device-src]

Specifies the ID of the source device for a P2P test. This parameter must be used together with [-dd, --dd, --device-dst]. The values following the parameters must be different. If neither of the two parameters is specified, all Ascend NPUs are tested.

This parameter is not supported by the Atlas 200/300/500 inference products, Atlas 300I Pro inference card, Atlas 300V video analysis card, Atlas 300V Pro video analysis card, Atlas 200I SoC A1 core board, and Atlas 200I/500 A2 inference products.

No

[-dd, --dd, --device-dst]

Specifies the ID of the destination device for a P2P test. This parameter must be used together with [-ds, --ds, --device-src]. The values following the parameters must be different. If neither of the two parameters is specified, all Ascend NPUs are tested.

This parameter is not supported by the Atlas 200/300/500 inference products, Atlas 300I Pro inference card, Atlas 300V video analysis card, Atlas 300V Pro video analysis card, Atlas 200I SoC A1 core board, and Atlas 200I/500 A2 inference products.

No

[-o, --operation]

Specifies the data transmission operation type for a D2D test. The following options are supported:

  • read: read operation

  • write: write operation

If the parameter value is not specified, read is used by default.

This parameter is supported only by the Ascend 950PR&950DT products when type is set to d2d.

No

[--di, --direction]

Specifies the direction of a P2P bandwidth test. The following values are supported:

  • all: both unidirectional and bidirectional tests
  • uni: unidirectional test only
  • bid: bidirectional test only

If the parameter value is not specified, all is used by default.

This parameter is supported only by the Ascend 950PR&950DT products when type is set to p2p.

No

[-dur, --dur, --duration]

Specifies the traffic generation duration. The value ranges from 5 to 120, in seconds.

  • This parameter is supported only by the Ascend 950PR&950DT products when type is set to p2p.
  • This parameter can be used only when the value of --direction is uni or bid.
  • This parameter must be used together with --device-src and --device-dst.

No

[-lt, --lt, --link-type]

Specifies the data transmission operation type for a P2P test. The following values are supported:

  • ubc_mesh: mesh link
  • ubc_clos: CLOS link
  • ubc: concurrent mesh and CLOS links
  • ubg: UBG link

The value range varies with the server model.

  • Atlas 950 SuperPoD: ubc_mesh, ubc_clos, and ubc
  • Atlas 650/Atlas 650E/Atlas 850/Atlas 850E: ubc_mesh, ubc_clos, and ubc
  • Atlas 950 SuperPoD Flex: ubc_mesh, ubc_clos, ubg, and ubc

This parameter is not supported by the Atlas 650, Atlas 650E, Atlas 850, Atlas 850E, Atlas 950 SuperPoD, and Atlas 950 SuperPoD Flex.

No

Note:

  • In this document, the input or output device ID is the logic ID.
  • You can run the npu-smi info -m command to obtain the logic ID by viewing the value of Chip Logic ID on the GUI. The NPU ID is the physical chip ID.

Example

1. Measure the bandwidth and total time consumption without specifying parameters on the Atlas 800I A2. (If no parameter is specified, information about device 0 in H2D, D2H, and D2D directions will be returned and displayed in step mode).

ascend-dmi --bw -q

  • D2D mode

  • D2H mode

  • H2D mode

2. The following uses the Atlas 800I A2 as an example, where the test is run in fixed-length mode for 100 iterations on device 0 using a 128 MB data size.
  • H2D mode

    ascend-dmi --bw -t h2d -d 0 --et 100 -s 134217728 -q

  • D2H mode

    ascend-dmi --bw -t d2h -d 0 --et 100 -s 134217728 -q

3. Measure the bandwidth and total time consumption of the data transmitted between the same device on the Atlas 800I A2.

ascend-dmi --bw -t d2d -d 0 -q

4. Measures the transmission rate and total time consumption from the source device to the destination device.
  • The following uses the Atlas 800I A2 as an example, where data is transmitted to destination device 0 from source device 1 in P2P mode for 100 iterations with a data size of 128 MB.

    ascend-dmi --bw -t p2p --dd 0 --ds 1 --et 100 -s 134217728 -q

  • Perform a P2P test without specifying the source and destination devices on the Atlas 800I A2.

    ascend-dmi --bw -t p2p -q

5. Perform a P2P test on the Atlas 900 A3 SuperPoD without specifying the source and destination cards.

ascend-dmi --bw -t p2p -q --mode card

If the following information is displayed, the tool is running properly.

Unidirectional Peer to Peer Test Bandwidth Matrix(GB/s)
   C\C       0        1        2        3        4        5        6        7
   0         ***      328.96   328.98   329.02   329.08   329.04   329.17   328.99
   1         328.61   ***      328.58   328.56   328.48   328.55   328.53   328.57
   2         328.57   328.49   ***      328.76   328.54   328.54   328.49   328.54
   3         328.52   328.46   328.55   ***      328.72   328.50   328.54   328.54
   4         329.02   329.05   328.99   329.03   ***      329.05   329.04   329.00
   5         328.70   328.58   328.51   328.57   328.59   ***      328.56   328.56
   6         328.56   328.53   328.63   328.58   328.61   328.57   ***      328.55
   7         328.95   328.49   328.56   328.61   328.55   328.56   328.54   ***   

Bidirectional Peer to Peer Test Bandwidth Matrix(GB/s)
   C\C       0        1        2        3        4        5        6        7
   0         ***      540.51   540.39   540.50   541.80   541.90   541.05   540.34
   1         540.90   ***      540.90   541.05   541.48   540.53   559.08   540.56
   2         540.95   541.40   ***      540.61   540.45   540.76   540.80   541.78
   3         540.97   540.87   541.61   ***      541.41   540.35   540.90   540.98
   4         541.30   541.04   540.82   542.88   ***      540.40   541.13   540.68
   5         540.68   541.14   541.86   540.80   540.44   ***      540.80   540.36
   6         540.54   540.91   540.98   541.03   540.63   541.20   ***      541.27
   7         540.51   542.78   540.91   541.69   540.22   540.95   541.02   ***   

6. Perform an H2D test with the size of 128 MB specified on all devices on the Atlas 350 accelerator card.

ascend-dmi --bw -t h2d -d all -s 134217728 -q

Host to Device Test
Device  0, 1, 2, 3, 4, 5, 6, 7: Ascend950PR.
-------------------------------------------------------------------
 ID  Size(Bytes)  Execute Times  Bandwidth(GB/s)  Elapsed Time(us)
-------------------------------------------------------------------
  0   134217728         40           53.585368     2522.2719
  1   134217728         40           53.582677     2522.8679
  2   134217728         40           53.714605     2517.0803
  3   134217728         40           51.016660     2646.5237
  4   134217728         40           51.674822     2615.6962
  5   134217728         40           52.444271     2575.9101
  6   134217728         40           51.731377     2612.8769
  7   134217728         40           53.920725     2507.3290
-------------------------------------------------------------------

7. Perform an h2d_d2h test with the size of 128 MB specified on device 1 on the Atlas 350 accelerator card.

ascend-dmi --bw -t h2d_d2h -d 1 -s 134217728 -q

Host to Device Test
Device  1: Ascend950DT.
-------------------------------------------------------------------
 ID  Size(Bytes)  Execute Times  Bandwidth(GB/s)  Elapsed Time(us) 
-------------------------------------------------------------------
  1   134217728         40           42.012817       3194.86
-------------------------------------------------------------------

8. Perform a unidirectional P2P traffic generation test from source device 1 to destination device 0 on the Ascend 950PR&950DT products.

ascend-dmi --bw -t p2p --dur 5 --dd 0 --ds 1 --di uni -q

Unidirectional Peer to Peer Test
Device  1 (Ascend950PR) to Device  0 (Ascend950PR)
-----------------------------------------------------------------------
 ID      Size(Bytes)  Execute Times  Bandwidth(GB/s)  Elapsed Time(us)
-----------------------------------------------------------------------
 1->0     2097152          -           46.981144         46.81
-----------------------------------------------------------------------

9. Perform a P2P test from source device 0 to destination device 1 on the Ascend 950PR&950DT products, with the link type being ubc_mesh, and data size of 32 MB.

ascend-dmi --bw -t p2p --lt ubc_mesh --ds 0 --dd 1 -s 33554432 -q

Unidirectional Peer to Peer Test
Device  0 (Ascend950PR) to Device  1 (Ascend950PR)
-----------------------------------------------------------------------
 ID      Size(Bytes)  Execute Times  Bandwidth(GB/s)  Elapsed Time(us)
-----------------------------------------------------------------------
 0->1    33554432         40           50.406957        698.01
-----------------------------------------------------------------------

Bidirectional Peer to Peer Test
Transfer between Device  0 (Ascend950PR) and Device  1 (Ascend950PR)
-----------------------------------------------------------------------
 ID      Size(Bytes)  Execute Times  Bandwidth(GB/s)  Elapsed Time(us)
-----------------------------------------------------------------------
0<->1    33554432         40           95.420689        737.46
-----------------------------------------------------------------------

10. Perform a D2D test on device 0 of the Atlas 350 accelerator card, with the data transmission operation type being write.

ascend-dmi --bw -t d2d -o write -q

Device to Device Test
Device  0: Ascend950PR.
----------------------------------------------------------------
    Size(GB)  Execute Times  Bandwidth(GB/s)   Elapsed Time(us)
----------------------------------------------------------------
   29.36            1     1414.331787          20759.01
   29.36            1     1414.166382          20761.44
   29.36            1     1414.744873          20752.95
   29.36            1     1414.677490          20753.94
   29.36            1     1414.296997          20759.52
   29.36            1     1415.251221          20745.52
   29.36            1     1415.031860          20748.74
   29.36            1     1402.069702          20940.56
   29.36            1     1413.259521          20774.76
   29.36            1     1414.103394          20762.36
   29.36            1     1408.651733          20842.72
   29.36            1     1405.905640          20883.43
   29.36            1     1414.849731          20751.41
   29.36            1     1413.363159          20773.24
   29.36            1     1414.151611          20761.66
   29.36            1     1413.357178          20773.33
   29.36            1     1414.714722          20753.39
   29.36            1     1414.094971          20762.49
   29.36            1     1413.133057          20776.62
   29.36            1     1390.780640          21110.54
   29.36            1     1414.822998          20751.80
   29.36            1     1412.628784          20784.04
   29.36            1     1413.136841          20776.56
   29.36            1     1414.834717          20751.63
   29.36            1     1405.618652          20887.69
----------------------------------------------------------------

The following table describes the parameters in the preceding examples.

Table 2 Parameter description

Parameter

Description

Host to Device Test

Data flow direction. The value can be:
  • Host to Device Test
  • Device to Host Test
  • Device to Device Test
  • Unidirectional Peer to Peer Test
  • Bidirectional Peer to Peer Test

Device X : Ascend XXX

Device X indicates the ID of the current device, and Ascend XXX indicates the processor type.

The value 0 indicates the source device, and the value 1 indicates the destination device.

ID

0 indicates the bandwidth of device 0 in D2D, D2H, and H2D modes.

0→1 indicates unidirectional P2P bandwidth from device 0 to device 1.

0→1 indicates bidirectional P2P bandwidth between device 0 and device 1.

Size(Bytes)

Size(GB)

Size of data to be transmitted, in bytes or GB.

Execute Times

Number of iterations

Bandwidth(GB/s)

Chip bandwidth

Elapsed Time(us)

Execution duration

FAQs