Skip to content

Add --use-device-time to shared comms args - #226

Draft
rootkiller6788 wants to merge 1 commit into
facebookresearch:mainfrom
rootkiller6788:fix-missing-use-device-time-arg
Draft

rootkiller6788 wants to merge 1 commit into
facebookresearch:mainfrom
rootkiller6788:fix-missing-use-device-time-arg

Conversation

@rootkiller6788

Copy link
Copy Markdown

What

commsTraceReplay.py (and dlrm.py) crash at startup with

AttributeError: 'Namespace' object has no attribute 'use_device_time'

because commsParamsHolderBase.__init__ reads args.use_device_time, but the --use-device-time flag was only registered by commsCollBench.readArgs in comms.py. Benches built on the shared base ParamCommsBenchBase.readArgs (trace replay, DLRM) never got the argument.

Fix

  • Register --use-device-time (default False) in ParamCommsBenchBase.readArgs so every comms bench accepts it.
  • Remove the now-duplicate registration from commsCollBench.readArgs in comms.py.

This also makes --use-device-time usable on the replay path, matching commsParamsHolderBase's existing handling.

Verification

  • Reproduced the original AttributeError on current main via the replay bench arg parser.
  • After the fix, commsParamsHolderBase constructs for trace-replay, DLRM, collective, compute and overlap benches, and --use-device-time is accepted.
  • Added 3 regression tests in train/comms/pt/tests/commsTraceReplay_tests.py; the full commsTraceReplay_tests + comms_utils_tests suite passes (38/38).

Closes #213

--use-device-time was only registered by commsCollBench (comms.py), but
commsParamsHolderBase unconditionally reads args.use_device_time.
Benches that rely on the shared base readArgs (commsTraceReplay.py,
dlrm.py) therefore crashed at startup with
AttributeError: 'Namespace' object has no attribute 'use_device_time'.

Move the flag into ParamCommsBenchBase.readArgs so every comms bench
accepts it, and drop the now-duplicate registration in comms.py.
Add regression tests for the replay bench args.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Errors encounter while running the replay bench

1 participant