Skip to content

Conversation

@taroigarashi2001
Copy link
Contributor

This PR fixes all type checking errors using ty inside the tx/layers folder as requested in #673.

(base) ray@4de7f1d7011b:/workspace/SkyRL/skyrl-tx$ uv run --extra dev ty check tx/layers/util.py 
All checks passed!
(base) ray@4de7f1d7011b:/workspace/SkyRL/skyrl-tx$ uv run --extra dev ty check tx/layers/lora.py 
All checks passed!

Once I finish with with the entire skyrl-tx folder, I'll add it to CI.

@taroigarashi2001
Copy link
Contributor Author

@pcmoritz @tyler-griggs Please take a look at your earliest convenience.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses type checking issues in tx/layers/lora.py by adding necessary imports, type hints, and runtime checks. The changes are a good step towards improving type safety. My review includes a few suggestions to further enhance the code. I've recommended combining imports for better readability and replacing assert statements with more robust runtime checks using if/raise to prevent potential issues in production environments where assertions might be disabled.

taroigarashi2001 and others added 3 commits November 17, 2025 22:05
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@pcmoritz pcmoritz added the tx label Nov 19, 2025
Copy link
Collaborator

@pcmoritz pcmoritz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the contribution! I removed the tx/models/__init__.py since it often leads to circular imports and simplified the handling of the model class :)

@pcmoritz pcmoritz merged commit 7e84154 into NovaSky-AI:main Nov 19, 2025
4 checks passed
*shape_A,
dtype=dtype,
kernel_init=nnx.with_partitioning(nnx.initializers.he_uniform(), sharding_A),
kernel_init=nnx.with_partitioning(nnx.initializers.he_uniform(), tuple(sharding_A)),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this was invalid, it generates W1119 05:41:01.754788 47420 spmd_partitioner.cc:4935] You have to use Shardy for RaggedDot. If not, the behavior is undefined.

Will fix it with #682

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind, this warning seems to actually come from the recently released Jax 0.8.1

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created an issue here jax-ml/jax#33403

pcmoritz added a commit that referenced this pull request Nov 19, 2025
Some additional fixes on top of
#681 and also some more errors
that happen when upgrading ty to the recently released 0.0.1a27

Makes the signatures slightly stricter with less defaults too.
li-boxuan pushed a commit to li-boxuan/SkyRL that referenced this pull request Nov 23, 2025
This PR fixes all type checking errors using `ty` inside the `tx/layers`
folder as requested in NovaSky-AI#673.

```
(base) ray@4de7f1d7011b:/workspace/SkyRL/skyrl-tx$ uv run --extra dev ty check tx/layers/util.py 
All checks passed!
(base) ray@4de7f1d7011b:/workspace/SkyRL/skyrl-tx$ uv run --extra dev ty check tx/layers/lora.py 
All checks passed!
```

Once I finish with with the entire `skyrl-tx` folder, I'll add it to CI.

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Philipp Moritz <pcmoritz@gmail.com>
li-boxuan pushed a commit to li-boxuan/SkyRL that referenced this pull request Nov 23, 2025
Some additional fixes on top of
NovaSky-AI#681 and also some more errors
that happen when upgrading ty to the recently released 0.0.1a27

Makes the signatures slightly stricter with less defaults too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants