• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pytorch / opacus / 17571477754
80%

Build:
DEFAULT BRANCH: main
Ran 09 Sep 2025 04:14AM UTC
Jobs 3
Files 131
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

21 Aug 2025 06:55PM UTC coverage: 80.498% (-0.2%) from 80.684%
17571477754

push

github

facebook-github-bot
Tensor Parallelism -- Review Version (#776)

Summary:
Pull Request resolved: https://github.com/pytorch/opacus/pull/776

We add a class named `grad_sample_module_fast_gradient_clipping_tp` to support 1D tensor parallelism for Opacus. We demonstrate the effectiveness on a toy example (examples/tp_toy.py) and llama 2 model (examples/tp_llama.py).

The key contribution is to understand when merging per-sample norms from different local devices, the operation should be `reduce_all` or just keep the norm from device 0. Specifically, under the following exceptions:
1. The parameter is not a DTensor.
2. The model is nn.embedding and under RowWiseParallel.
3. The parameter is nn.linear.bias under RowWiseParallel.
We should not merge the per-sample norm from local devices, but maintain the one from device 0.

Currently, we do not support
1. Vanilla Opacus mode (non-GC).
2. Sequential Parallelism (usually applied to LayerNormalization).
3. Modify/customize the placements of module outputs, which might lead to wrong behavior of norm calculation.
4. Trainable parameter being a plain tensor or replicated because of the constraint of the optimizer.

Reviewed By: aparna-aketi

Differential Revision: D79062242

fbshipit-source-id: ffaf071d1

13 of 32 new or added lines in 3 files covered. (40.63%)

5556 of 6902 relevant lines covered (80.5%)

1.79 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
19
36.67
opacus/grad_sample/grad_sample_module_fast_gradient_clipping_tp.py
Jobs
ID Job ID Ran Files Coverage
1 run-3 - 17571477754.1 09 Sep 2025 04:14AM UTC 70
47.81
GitHub Action Run
2 run-1 - 17571477754.2 09 Sep 2025 04:21AM UTC 130
80.28
GitHub Action Run
3 run-2 - 17571477754.3 09 Sep 2025 04:22AM UTC 130
80.27
GitHub Action Run
Source Files on build 17571477754
  • Tree
  • List 131
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #17571477754
  • 64609f35 on github
  • Prev Build on main (#17088281148)
  • Next Build on main (#17587757998)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc