Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint fixes introduced with Rust 1.83 #2646

Merged
merged 10 commits into from
Nov 28, 2024

Conversation

AnubhabB
Copy link
Contributor

Primarily 2 sources of warnings/ errors:

Clippy complains about Needless Lifetimes:

#[warn(clippy::needless_lifetimes)]

185 | impl<'a> Load for st::TensorView<'a> {
    |      ^^                          ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    = note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
    |
185 - impl<'a> Load for st::TensorView<'a> {
185 + impl Load for st::TensorView<'_> {

Manual Ceil Div

#[warn(clippy::manual_div_ceil)]

warning: manually reimplementing `div_ceil`
   --> candle-core/src/quantized/gguf_file.rs:460:34
    |
460 |         let tensor_data_offset = (position + alignment - 1) / alignment * alignment;
    |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `position.div_ceil(alignment)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil
    = note: `#[warn(clippy::manual_div_ceil)]` on by default

All test cases seem to pass for cuda, metal and cpu across multiple runs.

@LaurentMazare LaurentMazare merged commit 54e7fc3 into huggingface:main Nov 28, 2024
21 checks passed
@LaurentMazare
Copy link
Collaborator

Thanks!

@AnubhabB AnubhabB deleted the lint-fixes branch November 28, 2024 22:01
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.

2 participants