Skip to main content

net_prof

net_prof is a network profiler library aimed to profile the HPE Cray Cassini Network Interface Card (NIC) on a compute node to collect, analyze and visualize the network counter events. This tool will help to compare and diagnose a successful workload without any network issues with an unsuccessful workload due to a network issue. net-prof summary reports help to understand, analyze, and optimize current network bandwidth usage for any type of communication — whether it’s ping, point-to-point, send-receive, MPI collectives, or PyTorch CCL collectives — by pinpointing why the current communication API is not achieving its theoretical peak performance.

To Install

pip install net_prof

Functions

collect(input_directory, output.json)
summarize(before, after)
dump(summary)
dump_html(summary, output.html)

Example Utilizing multi-NIC

import net_prof

net_prof.collect("../sys/class/cxi", "/path/to/file/before.json"))
# Perform some sort of action between before and after.
net_prof.collect("../sys/class/cxi", "/path/to/file/after.json"))

summary = net_prof.summarize("/path/to/file/before.json", "/path/to/file/after.json")

net_prof.dump(summary)
net_prof.dump_html(summary, "/path/to/file/report.html")

Instructions for single-NIC collection

If you want to collect a single-NIC, pass in the /telemetry/ directory, otherwise, provide a /cxi/ directory. For example: Instead of giving a ../sys/class/cxi/ directory:

net_prof.collect("../sys/class/cxi", os.path.join(script_dir, "before.json"))

pass in the whole directory up to /telemetry of specific NIC:

net_prof.collect("../sys/class/cxi/cxi0/device/telemetry", os.path.join(script_dir, "before.json"))

Test used by Aurora:

import os
import net_prof

target_host = "x4306c7s2b0n0.hostmgmt2306.cm.aurora.alcf.anl.gov"

net_prof.collect("/sys/class/cxi/","/lus/flare/projects/datascience/kaushik/network/net-prof-tests/ping-test/before.json")
os.system(f"ping -c 4 {target_host}") 
net_prof.collect("/sys/class/cxi/","/lus/flare/projects/datascience/kaushik/network/net-prof-tests/ping-test/after.json")

summary = net_prof.summarize("/lus/flare/projects/datascience/kaushik/network/net-prof-tests/ping-test/before.json", "/lus/flare/projects/datascience/kaushik/network/net-prof-tests/ping-test/after.json")

net_prof.dump(summary)
net_prof.dump_html(summary, "/lus/flare/projects/datascience/kaushik/network/net-prof-tests/ping-test/net_prof_report.html")

Pytorch example:

import net_prof
import torch.distributed as dist

net_prof.collect("../sys/class/cxi", "/path/to/file/before.json"))
dist.init_process_group(backend="nccl")   # or gloo
x = torch.tensor([1.0], device="cuda")
dist.all_reduce(x, op=dist.ReduceOp.SUM)
net_prof.collect("../sys/class/cxi", "/path/to/file/after.json"))

summary = net_prof.summarize("/path/to/file/before.json", "/path/to/file/after.json")

net_prof.dump(summary)
net_prof.dump_html(summary, "/path/to/file/report.html")

Healthy vs. Faulty Ping Test:

Net-Prof lets you contrast a good and bad run to pinpoint which NIC counters change.

# Simulated "Healthy Node"

import net_prof, os

target = "good-node"

net_prof.collect("/sys/class/cxi", "before_healthy.json")
os.system(f"ping -c 4 {target}")
net_prof.collect("/sys/class/cxi", "after_healthy.json")

net_prof.dump_html(net_prof.summarize("before_healthy.json", "after_healthy.json"),
                   "report_healthy.html")
# Simulated "Faulty Node"

import net_prof, os

target = "bad-node"          # simulate issue (e.g., firewall drop)

net_prof.collect("/sys/class/cxi", "before_faulty.json")
os.system(f"ping -c 4 {target}")   # expect high loss / timeout
net_prof.collect("/sys/class/cxi", "after_faulty.json")

net_prof.dump_html(net_prof.summarize("before_faulty.json", "after_faulty.json"),
                   "report_faulty.html")

Notes

  • We are aware that the Ping issue may not be purely due to cxi or nics, there could be many other reasons like memory, network switches or hardware going down, however this tool is helpful to gain network insights.
  • A function such as compare() should be devoloped -- This could allow a user to compare a "idle" test to a "real" test, which visualizes changes between the tests.

It could be implemented as such:

# DO NOT FOLLOW THIS CODE. THIS IS A REPRESENTATION OF WHAT CAPABALITIES I WANT net_prof TO HAVE IN THE FUTURE
# psuedocode:

net_prof.collect(before_idle.json)
time.sleep(5) # doing effectively "nothing" or just idling...
net_prof.collect(after_idle.json)

idle_test = net_prof.summarize(before_idle.json, after_idle.json)

net_prof.collect(before_ping.json)
os.system(f"ping -c 4 {target}") 
net_prof.collect(after_ping.json)

ping_test = net_prof.summarize(before_ping.json, after_ping.json)

compare(idle_test, ping_test, report_idle_vs_ping.html)

Profiler Snapshots

Alt text Alt text Alt text Alt text Alt text

References

https://cpe.ext.hpe.com/docs/latest/getting_started/HPE-Cassini-Performance-Counters.html

https://github.com/argonne-lcf/net_prof

https://pypi.org/project/net_prof/

Metadata

Release files for net-prof 0.1.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for net-prof 0.1.11
File Size Uploaded Provenance Actions
net_prof-0.1.11.tar.gz 28.3 kB Without provenance Details for net_prof-0.1.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for net-prof 0.1.11
File Interpreter ABI Platform Actions
net_prof-0.1.11-py3-none-any.whl Python 3 none any Details for net_prof-0.1.11-py3-none-any.whl

Total release size: 55.2 kB

Release files / net_prof-0.1.11.tar.gz

Download URL net_prof-0.1.11.tar.gz
Size 28.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9eb593e2ad6e679230004a9d9613c8f08ca3841642961b889770a617ae4f0782
BLAKE2b-256 checksum
How to use checksums
61e56bfec18396f7d885bb2ed8daa50e038a1ad9dced9837b3270c7d130e40d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Release files / net_prof-0.1.11-py3-none-any.whl

Download URL net_prof-0.1.11-py3-none-any.whl
Size 26.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
564a266c2cec4aa12b48e9608adb46755eaf9e811ba9bce0b6c5b4e2691e977a
BLAKE2b-256 checksum
How to use checksums
9089e27d49c0822430dd53acfc3434cec4b463fb7f54247cd396b42b9d11bbfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Security for net-prof 0.1.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page