Skip to content

v2.1.20#672

Merged
joellidin merged 6 commits intomainfrom
dev
Jan 5, 2026
Merged

v2.1.20#672
joellidin merged 6 commits intomainfrom
dev

Conversation

@joellidin
Copy link
Copy Markdown
Collaborator

  • Revert "(neurons) Revert debug dict sampling indices"
  • Revert "feat: implement Tensor Parallelism (TP) support"
  • (comms) Add gradient shape validation to gather
  • (tests) Add gradient shape validation tests
  • Bump run version

Description

Related Issue(s)

  • Closes #[issue number]

Type of Change

  • Feature (adding new functionality)
  • Fix (resolving a bug or issue)
  • Docs (documentation updates)
  • Refactor (code changes that don't affect functionality)
  • Maintenance (dependency updates or other maintenance)
  • Tests (adding or improving tests)
  • Breaking change (fix or feature with incompatible API changes)
  • Other: _____

Branch Naming

  • My branch follows the project's naming convention (e.g., feature/add-new-capability)

Commit Messages

  • My commits are small, atomic, and have proper commit messages
  • Commit messages are in imperative mood with a capitalized summary under 50 chars

Code Quality

  • I've performed a self-review of my code
  • I've added appropriate docstrings following the project's conventions
  • I've added proper logging where necessary (without trailing periods)
  • I've applied linting and formatting with Ruff
  • My code generates no new warnings

Testing

  • I've added tests for new functionality or bug fixes
  • All tests pass locally with my changes
  • Test coverage has not decreased

Documentation

  • I've updated documentation to reflect my changes
  • I've updated comments in hard-to-understand areas

If this is a breaking change

Screenshots/Examples

Additional Notes

Add xshapes parameter to gather() function to validate gradient tensor
shapes during the transition period, rejecting sharded uploads that
don't match expected model dimensions.

- Add xshapes parameter to gather() function signature
- Validate vals tensor shape prefix against expected xshapes
- Log warning and reject responses with shape mismatches
- Update miner.py to pass xshapes=self.xshapes to gather
- Update validator.py to pass xshapes=self.xshapes to gather

This prevents sharded gradients from being accepted during the
transition period before full shard support is enabled.
Add three new test cases to verify xshapes-based gradient shape
validation in comms.gather():

- test_gather_rejects_sharded_gradient_shape: Verifies that gradients
  with mismatched dimensions (e.g., sharded instead of full) are
  properly rejected when xshapes is provided

- test_gather_accepts_correct_gradient_shape: Ensures gradients with
  correct shapes are accepted when xshapes validation is enabled

- test_gather_without_xshapes_accepts_all: Confirms that shape
  validation is skipped entirely when xshapes parameter is None

These tests protect against miners uploading incorrectly shaped
gradients (particularly sharded gradients when full gradients are
expected).
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 5, 2026

Warning

Rate limit exceeded

@joellidin has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 13 minutes and 55 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between bc7e48e and 92b66a9.

📒 Files selected for processing (22)
  • .gitignore
  • neurons/evaluator.py
  • neurons/miner.py
  • neurons/trainer.py
  • neurons/validator.py
  • scripts/abort_multipart_uploads.py
  • scripts/cleanup_bucket.py
  • src/tplr/__init__.py
  • src/tplr/chain.py
  • src/tplr/comms.py
  • src/tplr/compress.py
  • src/tplr/distributed.py
  • src/tplr/hparams.py
  • src/tplr/model_factory.py
  • src/tplr/neurons.py
  • src/tplr/sharded_sampler.py
  • tests/test_comms.py
  • tests/test_evaluator.py
  • tests/test_model_comparison.py
  • tests/test_prepare_gradient_dict.py
  • tests/unit/test_model_factory.py
  • tests/unit/test_neurons.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 5, 2026

Codecov Report

❌ Patch coverage is 81.01266% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/tplr/neurons.py 66.66% 9 Missing ⚠️
src/tplr/chain.py 0.00% 2 Missing ⚠️
src/tplr/model_factory.py 92.59% 2 Missing ⚠️
src/tplr/compress.py 66.66% 1 Missing ⚠️
src/tplr/hparams.py 80.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (81.01%) is below the target coverage (85.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project status has failed because the head coverage (57.72%) is below the target coverage (85.00%). You can increase the head coverage or adjust the target coverage.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #672      +/-   ##
==========================================
+ Coverage   56.45%   57.72%   +1.27%     
==========================================
  Files          27       27              
  Lines        5165     4975     -190     
==========================================
- Hits         2916     2872      -44     
+ Misses       2249     2103     -146     
Files with missing lines Coverage Δ
src/tplr/__init__.py 100.00% <100.00%> (ø)
src/tplr/comms.py 65.39% <100.00%> (+2.22%) ⬆️
src/tplr/distributed.py 17.64% <ø> (+1.11%) ⬆️
src/tplr/sharded_sampler.py 92.53% <100.00%> (+5.95%) ⬆️
src/tplr/compress.py 80.96% <66.66%> (+3.39%) ⬆️
src/tplr/hparams.py 60.52% <80.00%> (-1.67%) ⬇️
src/tplr/chain.py 36.02% <0.00%> (+0.65%) ⬆️
src/tplr/model_factory.py 61.08% <92.59%> (+1.22%) ⬆️
src/tplr/neurons.py 75.40% <66.66%> (+4.59%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@joellidin joellidin merged commit f511f08 into main Jan 5, 2026
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant