Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api/device): add methods to query PCIe and NVLink throughput #87

Merged
merged 11 commits into from
Aug 13, 2023

Conversation

XuehaiPan
Copy link
Owner

@XuehaiPan XuehaiPan commented Aug 4, 2023

Issue Type

  • Improvement/feature implementation

Description

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'

Motivation and Context

Resolves #82

@XuehaiPan XuehaiPan added enhancement New feature or request pynvml Something related to the `nvidia-ml-py` package api Something related to the core APIs labels Aug 4, 2023
@XuehaiPan XuehaiPan self-assigned this Aug 4, 2023
@XuehaiPan XuehaiPan changed the title feat(api/device): add methods to query PCI-e and NVLink throughput feat(api/device): add methods to query PCIe and NVLink throughput Aug 8, 2023
@XuehaiPan XuehaiPan merged commit ec4ad64 into main Aug 13, 2023
1 check passed
@XuehaiPan XuehaiPan deleted the throughput branch August 13, 2023 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Something related to the core APIs enhancement New feature or request pynvml Something related to the `nvidia-ml-py` package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Add support for PCIE throughput and NVLink throughput
1 participant