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

pytorch / opacus / 12970029985
80%

Build:
DEFAULT BRANCH: main
Ran 26 Jan 2025 01:09AM UTC
Jobs 3
Files 116
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

26 Jan 2025 01:01AM UTC coverage: 86.88% (+0.2%) from 86.711%
12970029985

push

github

facebook-github-bot
Modifying DPLossFastGradientClipping to add support for generative tasks with ghost clipping (#722)

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

Generative tasks for NLP output predictions of shape (B,T,C) i.e., (batch_size, sequence_length, vocab_size). To compute the cross-entropy loss in this case, usually the predictions are reshaped to (BxT, C) and targets to (BxT). This creates an issue with Ghost Clipping per sample loss computation as BxT is seen as the batch_size. In particular, the current implementation of Ghost Clipping results in loss_per_sample, coeff variables to have a shape of BxT and B respectively. This causes a shape mismatch error. This diff fixes that error by collapsing the loss_per_sample variable to shape B i.e., the loss across the sequence_length dim is averaged/summed.

Reviewed By: EnayatUllah

Differential Revision: D68047256

fbshipit-source-id: ad7614e2c

4 of 10 new or added lines in 1 file covered. (40.0%)

1 existing line in 1 file now uncovered.

5099 of 5869 relevant lines covered (86.88%)

1.94 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
6
72.34
-10.16% opacus/utils/fast_gradient_clipping_utils.py

Uncovered Existing Lines

Lines Coverage ∆ File
1
94.74
-5.26% opacus/tests/grad_samples/conv3d_test.py
Jobs
ID Job ID Ran Files Coverage
1 run-2 - 12970029985.1 26 Jan 2025 01:22AM UTC 115
86.73
GitHub Action Run
2 run-3 - 12970029985.2 26 Jan 2025 01:09AM UTC 65
48.82
GitHub Action Run
3 run-1 - 12970029985.3 26 Jan 2025 01:21AM UTC 115
86.54
GitHub Action Run
Source Files on build 12970029985
  • Tree
  • List 116
  • Changed 7
  • Source Changed 1
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #12970029985
  • c7d61443 on github
  • Prev Build on main (#12943075866)
  • Next Build on main (#12971303704)
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