Skip to main content

A monkey-patching tool for tracing collective operations

Project description

collective_trace

Pylint

Trace collective operations for distributed training.

0x01 Develop

# Develop
git clone https://github.com/yangrudan/collective_trace.git
cd collective_trace
pip install -e .

cd ..
torchrun --nproc_per_node=4 -m collective_trace.tests.test_in_torch
torchrun --nproc_per_node=4 -m collective_trace.tests.test_in_cpu --sync_mode 

# or
cd collective_trace
PYTHONPATH=/home/yang torchrun --nproc_per_node=4 tests/test_in_torch.py

0x02 Usage

# Install
git clone https://github.com/yangrudan/collective_trace.git
cd collective_trace
pip install -e .

Manual update training code:

import torch
import torch.distributed as dist

from collective_trace.collective_trace import trace_all_collectives

trace_all_collectives(trace_file='collective_trace.log')

import megatron  # Megatron此时导入的是已替换的函数
# Your training code here

version 0.1 Results Results

0x03 Util

cd utils
python parse_coll_info.py

log

export PYTHONPATH=/home/yang:$PYTHONPATH # 设置环境变量

import sys sys.path.insert(0, '/home/yang') # 把 /home/yang 路径添加到搜索路径的最前面

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

collective_trace-0.1.1.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

collective_trace-0.1.1-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file collective_trace-0.1.1.tar.gz.

File metadata

  • Download URL: collective_trace-0.1.1.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for collective_trace-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ddd82dca483433be6dd6398f9644df1a01def4f231ca76ccbbd1c1312f98ff5c
MD5 5222f8728e0f3c4eeb9e44355145990a
BLAKE2b-256 42d081110c340341897b9f9c16b33e41943da2aa33c01cdb1ac7c0abca3a7f3d

See more details on using hashes here.

File details

Details for the file collective_trace-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for collective_trace-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 081664dd1097db0d13544f6d09a6c84fbdd414a8cf6ac43f3f157c3ec8c466de
MD5 675c262538571db3f61dd5b6432a8091
BLAKE2b-256 bba7aabf96ccf73cd8df5f094cf0a891918f005dfe6320c7e30b16d73c043423

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page