Closed XuehaiPan closed 1 year ago
Add methods to query PCIe and NVLink throughput.
In [1]: from nvitop import * In [2]: d = Device(0) In [3]: d.nvlink_mean_tx_throughput_human() # mean TX throughput over all NVLinks Out[3]: '257.6MiB/s' In [4]: d.nvlink_tx_throughput_human() # we have 12-NVLinks Out[4]: ['234.7MiB/s', '234.7MiB/s', '234.7MiB/s', '234.7MiB/s', '234.7MiB/s', '234.7MiB/s', '234.7MiB/s', '234.7MiB/s', '234.7MiB/s', '234.7MiB/s', '234.7MiB/s', '234.7MiB/s'] In [5]: d.nvlink_rx_throughput_human() # we have 12-NVLinks Out[5]: ['2700MiB/s', '2700MiB/s', '2700MiB/s', '2700MiB/s', '2700MiB/s', '2700MiB/s', '2700MiB/s', '2700MiB/s', '2700MiB/s', '2700MiB/s', '2700MiB/s', '2700MiB/s'] In [6]: d.nvlink_throughput() # we have 12-NVLinks Out[6]: [ThroughputInfo(tx=2619858, rx=2596953), # in KiB/s ThroughputInfo(tx=2619815, rx=2596953), ThroughputInfo(tx=2619939, rx=2596953), ThroughputInfo(tx=2619939, rx=2596953), ThroughputInfo(tx=2619860, rx=2596953), ThroughputInfo(tx=2619860, rx=2596953), ThroughputInfo(tx=2619860, rx=2596953), ThroughputInfo(tx=2619819, rx=2596953), ThroughputInfo(tx=2619942, rx=2596953), ThroughputInfo(tx=2619939, rx=2596953), ThroughputInfo(tx=2619861, rx=2596953), ThroughputInfo(tx=2619861, rx=2596953)] In [7]: d.pcie_throughput() # in KiB/s Out[7]: ThroughputInfo(tx=7000, rx=12000) In [8]: d.pcie_tx_throughput() # in KiB/s Out[8]: 11000 In [9]: d.pcie_tx_throughput_human() Out[9]: '6.84MiB/s'
Resolves #82
Issue Type
Description
Add methods to query PCIe and NVLink throughput.
Motivation and Context
Resolves #82