Eduardo Pacheco
222505c7e4
[GroundingDino] Fix grounding dino loss 🚨 ( #31828 )
...
* Starting to fix GroundingDinoLoss and GroundingDinoHungarianMatcher
* More updates
* More updates
* fixed: GroundingDinoLoss
* fixed: failing tests
* Update src/transformers/models/grounding_dino/modeling_grounding_dino.py
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
* Update tests/models/grounding_dino/test_modeling_grounding_dino.py
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
* Update src/transformers/models/grounding_dino/modeling_grounding_dino.py
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
* Update src/transformers/models/grounding_dino/modeling_grounding_dino.py
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
* Update src/transformers/models/grounding_dino/modeling_grounding_dino.py
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
* Update src/transformers/models/grounding_dino/modeling_grounding_dino.py
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
* Update src/transformers/models/grounding_dino/modeling_grounding_dino.py
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
* Update src/transformers/models/grounding_dino/modeling_grounding_dino.py
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
* Update src/transformers/models/grounding_dino/modeling_grounding_dino.py
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
* Update src/transformers/models/grounding_dino/modeling_grounding_dino.py
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
* Addressed comments
* Update src/transformers/models/grounding_dino/modeling_grounding_dino.py
Co-authored-by: Sangbum Daniel Choi <34004152+SangbumChoi@users.noreply.github.com>
* add: cardinality loss and make box loss as copy from
* change: default for reduction loss is sum
* fix: vectorized generate fake box
* fix copies
* Addressed comments
* addressed comments
* addressed one-hot
* Update tests/models/grounding_dino/test_modeling_grounding_dino.py
Co-authored-by: Sangbum Daniel Choi <34004152+SangbumChoi@users.noreply.github.com>
* Addressed comments
* fixed test
* Update src/transformers/models/grounding_dino/modeling_grounding_dino.py
* Update tests/models/grounding_dino/test_modeling_grounding_dino.py
Co-authored-by: Pavel Iakubovskii <qubvel@gmail.com>
* Starting to fix GroundingDinoLoss and GroundingDinoHungarianMatcher
* More updates
* More updates
* fixed: GroundingDinoLoss
* add: cardinality loss and make box loss as copy from
* fix copies
* Revert "Update tests/models/grounding_dino/test_modeling_grounding_dino.py"
This reverts commit aa74c4c57c430e54cc74c414d6269edb65c73e83.
* [run-slow] groundigdino
* remove nestedtensor
* [run-slow] groundig_dino
* [run-slow] grounding_dino
* [run-slow] grounding_dino
* [run-slow] grounding_dino
* check
* check
* add: enconder intermediate outputs to ImageLoss forward
* add: GroundingDinoForObjectDetectionLoss in the loss directory
* make style
* fix the loss function
* remove class_reduction since it sum is default
* remove class_reduction
* Update src/transformers/loss/loss_grounding_dino.py
Co-authored-by: Pavel Iakubovskii <qubvel@gmail.com>
* simple fix
* Update src/transformers/loss/loss_grounding_dino.py
Co-authored-by: Pavel Iakubovskii <qubvel@gmail.com>
* minor fix
* Update src/transformers/loss/loss_for_object_detection.py
---------
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
Co-authored-by: Sangbum Daniel Choi <34004152+SangbumChoi@users.noreply.github.com>
Co-authored-by: Pavel Iakubovskii <qubvel@gmail.com>
Co-authored-by: sangbumchoi <danielsejong55@gmail.com>
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2025-02-27 19:15:58 +00:00
Yih-Dar
482d17be60
Fix hub_retry
( #36449 )
...
* cry
* trigger
---------
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2025-02-27 14:38:25 +01:00
Harry Mellor
6a876462c3
Lazy import libraries in src/transformers/image_utils.py
( #36435 )
...
* Lazy import libraries in `src/transformers/image_utils.py`
* `make fixup`
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
* Protect imports
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
---------
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
2025-02-27 12:53:42 +00:00
Joao Gante
8aed019764
[generate] torch.distributed
-compatible DynamicCache
( #36373 )
...
* test
* docstring
* prepare distributed cache data
* fix cat dim
* test mvp
* add test checks
* like this?
* working test and solution
* nit
* nit
* add shape info
2025-02-27 11:48:57 +00:00
wejoncy
17792556b2
[save_pretrained ] Skip collecting duplicated weight ( #36409 )
...
* Skip collecting duplicated weight
* format
2025-02-27 10:57:11 +01:00
Yih-Dar
2d6cc0dfde
Add contents: write
( #36445 )
...
fix permission
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2025-02-27 10:55:37 +01:00
Yih-Dar
549db241e5
Fix another permission ( #36444 )
...
* fix permission
* fix permission
---------
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2025-02-27 10:29:06 +01:00
Yih-Dar
a8e4fe45fd
Fix permission ( #36443 )
...
fix permission
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2025-02-27 10:08:31 +01:00
Yih-Dar
d0727d92cd
Change PR to draft when it is (re)opened ( #36417 )
...
* draft
* draft
* draft
* draft
* draft
* draft
* draft
* draft
* draft
* draft
* draft
* draft
* draft
* draft
* draft
* draft
* draft
* draft
* draft
* draft
* draft
* draft
* draft
* draft
* draft
* draft
* draft
* draft
---------
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2025-02-27 09:44:33 +01:00
Marc Sun
8ede897c30
restrict cache allocator to non quantized model ( #36428 )
2025-02-26 22:16:15 +01:00
Mohamed Mekkouri
a7fbab33ae
Fix Expected output for compressed-tensors tests ( #36425 )
...
fix
2025-02-26 21:17:24 +01:00
Arthur
1603018e7a
Update form pretrained to make TP a first class citizen ( #36335 )
...
* clean code
* oups
* fix merge
* yups
* fix if
* now you can play
* fix shape issue
* try non blocking
* fix
* updates
* up
* updates
* fix most of thetests
* update
* update
* small updates
* up
* fix the remaining bug?
* update
* rename when you read from the file
* buffer issues
* current status
* cleanup
* properly allocate dumb memory
* update a small bug
* fix colwise rep issue
* fix keep in float 32 that was keeping everything in float 32
* typo
* more fixes with keep_in_fp32_modules as we use to serach on it
* fix ROPE dtype for TP
* remove what's breaking the tests
* updates
* update and fixes
* small cleanup after merging
* allocate 2x to be safe
* style, auto
* update
* yup nit
* fix
* remove slow as fuck torch api :(
* work
* fixup
* update
* brting the fix back
* fix and update
* fixes
Co-authored-by: Marc Sun <57196510+SunMarc@users.noreply.github.com>
* updates because some suggestions were wrong 👀
* update?
* fuck this bloated function
* typo
* fix the dumb prefix thing once and forall
* fixes here and there
* updates
* remove prints
* fix strict cases
* styel
* properly fix keys on load!
* update
* fix base model prefix issue
* style
* update
* fix all?
* remoce 1 print
* fix the final etsts
* fixup
* last nits
* fix the detach issue which cause a 2x slowdown
* fixup
* small fixes
* ultra nit
* fix
* fix
---------
Co-authored-by: Marc Sun <57196510+SunMarc@users.noreply.github.com>
2025-02-26 20:12:38 +01:00
Mohamed Mekkouri
981c276a02
Fix compressed tensors config ( #36421 )
...
* fix config
* update
---------
Co-authored-by: Marc Sun <57196510+SunMarc@users.noreply.github.com>
2025-02-26 17:56:15 +01:00
Nadav Timor
d18d9c3205
Universal Speculative Decoding CandidateGenerator
( #35029 )
...
* move `TestAssistedCandidateGeneratorDifferentTokenizers` into a new testing file
* refactor
* NOTHING. add space to rerun github actions tests
* remove it...
* `UniversalSpeculativeDecodingGenerator`
* Use `UniversalSpeculativeDecodingGenerator` when `generation_config.do_sample=True`
* assistant tokenizes only the target's new suffix
* formatting
* fix code
* fix code
* formatting
* add `TestGenerateWithDifferentModels`
* `TestGenerateWithDifferentModels` parameterize on `do_sample`
* `AssistantVocabMapping` & `AssistantVocabMappingCache`
* formatting
* `AssistantToTargetTranslator`: `get_target_input_ids` & `get_target_logits`
* improve `_get_assistant_to_target_input_ids` & formatting
* renaming
* WIP: debugging `min_new_tokens`
* fix get_target_ids
* `UniversalSpeculativeDecodingGenerator`
* assistant tokenizes only the target's new suffix
* formatting
* fix code
* fix code
* formatting
* `TestGenerateWithDifferentModels` parameterize on `do_sample`
* `AssistantVocabMapping` & `AssistantVocabMappingCache`
* formatting
* `AssistantToTargetTranslator`: `get_target_input_ids` & `get_target_logits`
* improve `_get_assistant_to_target_input_ids` & formatting
* renaming
* WIP: debugging `min_new_tokens`
* fix get_target_ids
* fix device issue
* fix get_assistant_input_ids
* add `TestAssistedCandidateGeneratorDifferentTokenizers`
* formatting
* `AssistantVocabTranslatorCache` refactor & tests
* revert changes in `src/transformers/generation/logits_process.py`
* refactor `AssistedCandidateGenerator`
* refactor `AssistedCandidateGeneratorDifferentTokenizers`
* formatting
* refactor `UniversalSpeculativeDecodingGenerator`
* fix negative value for max_new_tokens
* fix generation length target + attention_mask vs. assistant + attent
* fix device
* fix negative max_new_tokens bug
* fix UAG
* minor
* formatting
* `AssistedCandidateGeneratorDifferentTokenizers` `lookbehind`s init
* resolve conflict & formatting
* rerun CI tests
* remove space...
* remove old code
* fix candidate_input_ids device
* minor
* formatting
* Fix prepare + apply (#7 )
* fix prepare + apply
* move to cpu
* simplity suppress_tokens
* fix bugs and refacatoring
* device move
* handle self.config.vocab_size > len(target_tokenizer.get_vocab())
* no need to normalize in candidate_generator
* address Nadav's comments + minor
* optimize device move + SuppressTokensLogitsProcessor
* AssistantToTargetTranslator, SuppressTokensLogitsProcessor and tokenizers mapping improvements
* padding size
* padding improvement
* fix and simplify get_target_logits
* renaming in get_target_logits
* minor
* add filter_value and suppress_tokens_id
* style + rename
* remove TODO
* restore original SelectTokensLogitsProcessor with modification
* fix style
* fix _update_past_and_masks and optimize code
* remove assistant_vocab_size arg
* fix attention_mask
* call _prepare_attention_mask also if not has_past_key_values
* handling attention mask for first generation
* comment
* restore test
* remove SelectTokensLogitsProcessor
* _update_past_and_masks implementation for USD
* Add unittests for Universal Assisted generation
* fix style
* update tests
* Remove unused import and fix `test_speculation_depth` test
* exclude special and reserved tokens from tokenizer for UAG
* mv `test_universal_assisted_generation.py` to `generation/test_candidate_generator.py`
* Remove unused imports and fix style using `make style` (#9 )
* formatting
* Swap gated `meta-llama/llama-3.2` with `allenai/llama` (#10 )
* Fix space sign disagreement (#12 )
* default values for AssistantToTargetTranslator fileds
* fix space sign
* minor
* fix test + style
* Default values for some fields of assistant to target translator (#11 )
* default values for AssistantToTargetTranslator fileds
* fix
* add support to empty logit_processors
* Update candidate_generator.py (#15 )
fix typo
* BUG fix in _prepare_assistant_input_ids (#14 )
* fix _prepare_assistant_input_ids
* target_to_assistant_input_ids
* Update src/transformers/generation/candidate_generator.py
Co-authored-by: Nadav Timor <nadav.timor@weizmann.ac.il>
---------
Co-authored-by: Nadav Timor <nadav.timor@weizmann.ac.il>
* typo (`target_to_assistant_input_ids`)
* formatting
* merge upstream/main
* Fix minor review comments (#16 )
* Fix: `token_ids.to(torch.int64)` (#18 )
* tok ids to `torch.int64` (reference: https://huggingface.co/docs/transformers.js/en/api/tokenizers )
* `LongTensor`
* fix dtype
* `assistant_input_ids.to(dtype=torch.long)`
* Remove unused import from test_candidate_generator.py
* Remove unused import from test_candidate_generator.py
* Remove `numpy` import
* resolve pr comments (#19 )
* `AssistantToTargetTranslator` docstring
* (per gante's comment) `filter_value` and `suppress_tokens_id` to class constants
* update `AssistantToTargetTranslator` docstring
* (gante's comment) replace `match-case`
* formatting
* Fix Joao's comments (#21 )
* remove threading
* fix logits_processor
* fix test device
* fix style (#23 )
* Move atm (#24 )
* move AssistantToTargetTranslator
* fixup
* fix logit_processor
* add atm_translator test
* refactor test
* remove threading from test
* add require_torch in tests
* move AssistantVocabTranslatorCache + add tests
* ruff fix
---------
Co-authored-by: jmamou <jonathan.mamou@intel.com>
Co-authored-by: Gaurav <gauravj@d-matrix.ai>
Co-authored-by: Gaurav Jain <gaurjain14@gmail.com>
Co-authored-by: gauravjain14 <41287729+gauravjain14@users.noreply.github.com>
2025-02-26 16:14:02 +00:00
Manny Cortes
082834dd79
fix: prevent model access error during Optuna hyperparameter tuning ( #36395 )
...
* fix: prevent model access error during Optuna hyperparameter tuning
The `transformers.integrations.integration_utils.run_hp_search_optuna` function releases model memory and sets trainer.model to None after each trial. This causes an AttributeError when subsequent Trainer.train calls attempt to access the model before reinitialization. This is only an issue when `fp16_full_eval` or `bf16_full_eval` flags are enabled.
* Update src/transformers/trainer.py
Co-authored-by: Marc Sun <57196510+SunMarc@users.noreply.github.com>
---------
Co-authored-by: Marc Sun <57196510+SunMarc@users.noreply.github.com>
2025-02-26 17:06:48 +01:00
zheliuyu
6513e5e402
add recommendations for NPU using flash_attn ( #36383 )
...
* add recommendations for Ascend NPU using flash_attn
* update recommend_message_npu
Co-authored-by: Marc Sun <57196510+SunMarc@users.noreply.github.com>
---------
Co-authored-by: Marc Sun <57196510+SunMarc@users.noreply.github.com>
2025-02-26 14:51:08 +01:00
Nicolas Patry
b4965cecc5
Fixing the docs corresponding to the breaking change in torch 2.6. ( #36420 )
2025-02-26 14:11:52 +01:00
Aymeric Roucher
9a217fc327
Deprecate transformers.agents ( #36415 )
2025-02-26 11:38:47 +01:00
Zach Mueller
41925e4213
Add retry hf hub decorator ( #35213 )
...
* Add retry torch decorator
* New approach
* Empty commit
* Empty commit
* Style
* Use logger.error
* Add a test
* Update src/transformers/testing_utils.py
Co-authored-by: Lucain <lucainp@gmail.com>
* Fix err
* Update tests/utils/test_modeling_utils.py
---------
Co-authored-by: Lucain <lucainp@gmail.com>
Co-authored-by: Yih-Dar <2521628+ydshieh@users.noreply.github.com>
2025-02-25 20:53:11 +01:00
Chulhwa (Evan) Han
9ebfda3263
Fixed VitDet for non-squre Images ( #35969 )
...
* size tuple
* delete original input_size
* use zip
* process the other case
* Update src/transformers/models/vitdet/modeling_vitdet.py
Co-authored-by: Pavel Iakubovskii <qubvel@gmail.com>
* [VITDET] Test non-square image
* [Fix] Make Quality
* make fix style
* Update src/transformers/models/vitdet/modeling_vitdet.py
---------
Co-authored-by: Pavel Iakubovskii <qubvel@gmail.com>
2025-02-25 19:31:24 +00:00
Yih-Dar
cbe0ea59f3
Security fix for benchmark.yml
( #36402 )
...
security
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2025-02-25 17:22:09 +01:00
Marcel
88d10517b4
Fix convert_to_rgb for SAM ImageProcessor ( #36369 )
2025-02-25 15:10:21 +00:00
Joao Gante
e1ce948908
[CLI] add import guards ( #36376 )
...
* add import guards
* nit
2025-02-25 15:06:50 +00:00
Pavel Iakubovskii
fb83befb14
Fix pytorch integration tests for SAM ( #36397 )
...
Fix device in tests
2025-02-25 14:53:34 +00:00
Afanti
ca6ebcb9bc
chore: fix function argument descriptions ( #36392 )
2025-02-25 14:28:34 +00:00
jiqing-feng
7c8916ddb5
fix audio classification pipeline fp16 test on cuda ( #36359 )
...
* fix audio classification pipeline fp16 test on cuda
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
* fix format
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
* add comments
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
* Update tests/pipelines/test_pipelines_audio_classification.py
---------
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
Co-authored-by: Yih-Dar <2521628+ydshieh@users.noreply.github.com>
2025-02-25 15:01:25 +01:00
Fanli Lin
c3700b0eee
[tests] enable autoawq tests on XPU ( #36327 )
...
add autoawq
Co-authored-by: Yih-Dar <2521628+ydshieh@users.noreply.github.com>
2025-02-25 13:38:09 +01:00
Dmitry Rogozhkin
b4b9da6d9b
tests: revert change of torch_require_multi_gpu to be device agnostic ( #35721 )
...
* tests: revert change of torch_require_multi_gpu to be device agnostic
The 11c27dd33
modified `torch_require_multi_gpu()` to be device agnostic
instead of being CUDA specific. This broke some tests which are rightfully
CUDA specific, such as:
* `tests/trainer/test_trainer_distributed.py::TestTrainerDistributed`
In the current Transformers tests architecture `require_torch_multi_accelerator()`
should be used to mark multi-GPU tests agnostic to device.
This change addresses the issue introduced by 11c27dd33
and reverts
modification of `torch_require_multi_gpu()`.
Fixes: 11c27dd33
("Enable BNB multi-backend support (#31098 )")
Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
* fix bug: modification of frozen set
---------
Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Co-authored-by: Titus von Koeller <9048635+Titus-von-Koeller@users.noreply.github.com>
Co-authored-by: Yih-Dar <2521628+ydshieh@users.noreply.github.com>
2025-02-25 13:36:10 +01:00
MAHIR DAIYAN
d80d52b007
addressing the issue #34611 to make FlaxDinov2 compatible with any batch size ( #35138 )
...
fixed the batch_size error, all tests are passing
Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>
2025-02-25 10:44:44 +00:00
andreystarenky
3a02fe56c2
Added handling for length <2 of suppress_tokens for whisper ( #36336 )
...
* Update generation_whisper.py
Added handling for <2 length of suppress_tokens for whisper
* Updated None check for suppress_tokens to avoid ambiguity
---------
Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>
2025-02-25 10:32:49 +00:00
Cyril Vallez
da4ab2a1b6
Fix doc formatting in forward passes & modular ( #36243 )
...
* fix indentation issues + modular without magic keyword
* style
* Update doc.py
* style
* Fix all decorators indentation
* all models
* style
* style
* Update doc.py
* fix
* general fix
* style
2025-02-25 11:09:01 +01:00
Jeff
92abc0dae8
Update _get_eval_sampler to reflect Trainer.tokenizer is deprecation self.tokenizer -> self.processing_class ( #36315 )
...
* fix warning self.tokenizer -> self.processing_class
* formating change
2025-02-25 11:07:50 +01:00
jiqing-feng
9d6abf9778
enable torchao quantization on CPU ( #36146 )
...
* enable torchao quantization on CPU
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
* fix int4
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
* fix format
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
* enable CPU torchao tests
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
* fix cuda tests
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
* fix cpu tests
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
* update tests
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
* fix style
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
* fix cuda tests
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
* fix torchao available
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
* fix torchao available
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
* fix torchao config cannot convert to json
* fix docs
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
* rm to_dict to rebase
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
* limited torchao version for CPU
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
* fix format
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
* fix skip
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
* fix format
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
* Update src/transformers/testing_utils.py
Co-authored-by: Marc Sun <57196510+SunMarc@users.noreply.github.com>
* fix cpu test
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
* fix format
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
---------
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
Co-authored-by: Mohamed Mekkouri <93391238+MekkCyber@users.noreply.github.com>
Co-authored-by: Marc Sun <57196510+SunMarc@users.noreply.github.com>
2025-02-25 11:06:52 +01:00
Cyril Vallez
401543a825
Fix is_causal
fail with compile ( #36374 )
...
fix
2025-02-25 10:44:56 +01:00
Cyril Vallez
bc65f3fc1c
[modular] Do not track imports in functions ( #36279 )
...
* Add check
* just check for function
* Update examples
2025-02-25 10:29:47 +01:00
Cyril Vallez
4b5cf5496d
Load models much faster on accelerator devices!! ( #36380 )
...
* caching allocator warmup
* Update modeling_utils.py
* reuse expanded map
* style
2025-02-25 09:41:22 +01:00
Yin Song
931e5f4ac3
Update modeling_llava_onevision.py ( #36391 )
...
Fixed a potential bug in modeling_llava_onevision.py
2025-02-25 09:34:50 +01:00
Yih-Dar
2ab7bdc403
notify new model merged to main
( #36375 )
...
notify new model
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2025-02-24 17:53:18 +01:00
Kyle Sayers
05dfed06d7
[Modeling] Reduce runtime when loading missing keys ( #36312 )
...
* hoist keys
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
* remove hoist
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
---------
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
2025-02-24 16:10:28 +00:00
Mathew Shen
18276b03f7
fix(type): padding_side type should be Optional[str] ( #36326 )
2025-02-24 16:09:42 +00:00
ivarflakstad
f4684a6eb2
Update amd pytorch index to match base image ( #36347 )
...
pip pytorch index should match docker base image
2025-02-24 16:17:20 +01:00
Jerry Zhang
2af272c101
Add autoquant support for torchao quantizer ( #35503 )
...
* Add autoquant support for torchao quantizer
Summary:
att, also verified that autoquantized model can be saved and loaded:
save: https://gist.github.com/jerryzh168/01d367aaf44dbbbfd4068a4a10a00061
load: https://gist.github.com/jerryzh168/d5c6c401b2abdf18e0b6771341f1525c
Test Plan:
tested locally with above script
model uploaded to https://huggingface.co/jerryzh168/llama3-8b-autoquant
Reviewers:
Subscribers:
Tasks:
Tags:
* add test
* ruff fix
* ruff reformat
* add docs and min_sqnr support
* format
* format
* fix test
* update doc
* format
* remove disable_compile
* format
2025-02-24 15:54:16 +01:00
ivarflakstad
977a61f743
Change slack channel for mi250 CI to amd-hf-ci ( #36346 )
2025-02-24 15:50:06 +01:00
Rahul Tuli
884a8ea1f0
Improve model loading for compressed tensor models ( #36152 )
...
* Disable warnings for stacked compressors
* Introduce two new hooks in HfQuantizer lifecycle
to allow updates to missing and unexpected keys
* Update missing and unexpected keys
for stacked compressors
* Add tests
* Fix: run_compressed cases
* Fix: uncompressed cases
* Rename compressed_tensor folder to compressed_tensors
Move RunCompressedTest to the same file
Update tests to unittest
2025-02-24 13:47:21 +01:00
Fanli Lin
4dbf17c17f
[tests] enable bnb tests on xpu ( #36233 )
...
* fix failed test
* fix device
* fix more device cases
* add more cases
* fix empty cache
* Update test_4bit.py
---------
Co-authored-by: Yih-Dar <2521628+ydshieh@users.noreply.github.com>
2025-02-24 11:30:15 +01:00
Matt
92c5ca9dd7
Fix exploitable regexes in Nougat and GPTSan/GPTJNeoXJapanese ( #36121 )
...
* Fix potential regex catastrophic backtracking in NougatTokenizerFast
The original regex pattern in tokenization_nougat_fast.py was vulnerable to
catastrophic backtracking due to greedy quantifiers and nested alternations.
This commit replaces it with a more efficient pattern that:
1. Uses explicit character classes instead of dot (.)
2. Handles whitespace more precisely
3. Avoids unnecessary backtracking
4. Supports both lowercase and uppercase roman numerals
5. Maintains the same functionality while being more robust
* Try another regex
* Trying deepseek's answer
* Start with a simplification
* Another simplification
* Just rewrite the whole function myself
* Fix gptneox and gptsan
* Simplify the regex even further
* Tighten up the price regex a little
* Add possessive version of the regex
* Fix regex
* Much cleaner regexes
---------
Co-authored-by: openhands <openhands@all-hands.dev>
2025-02-21 19:49:51 +00:00
CalOmnie
547911e727
Uses Collection in transformers.image_transforms.normalize ( #36301 )
...
* Uses Collection instead of Sequence in transformers.image_transforms.normalize
* Uses collections.abc.Collection in lieu of deprecated typing one
2025-02-21 18:38:41 +01:00
Fanli Lin
7c5bd24ffa
[tests] make quanto tests device-agnostic ( #36328 )
...
* make device-agnostic
* name change
2025-02-21 14:20:40 +01:00
Joao Gante
678885bbbd
[CI] Check test if the GenerationTesterMixin
inheritance is correct 🐛 🔫 ( #36180 )
2025-02-21 10:18:20 +00:00
Pavel Iakubovskii
a957b7911a
Add SigLIP 2 ( #36323 )
...
* Docs
* Inits
* Auto classes
* Add siglip base
* Add base tests
* Fix Siglip V1 for fix res version
* Add image processor
* Update conversion
* Experimenting with vectorized embeddings
* Fixup
* Add modular Siglip2Processor
* Add modular configuration
* Rename num patches
* Correct image and text features merging
* Working conversion script
* Refactoring conversion script
* Remove unused code in conversion script
* Shorten dict a bit
* Refactoring conversion
* Done conversion refactoring
* Fixup
* Modular siglip2
* Make model exportable and compilable without graph breaks
* Remove position_ids from image_processor
* REmove position ids from modeling file
* Update modular
* Type hint
* Fixup
* Set defaults to processor
* Add integration test
* Revert spatial shapes back to tensor
* Change order
* Fix most of the tests
* Fix docstring
* Remove interpolate_pos_encoding arg (not needed)
* Update docs
* Standardize processing
* Fix attention_mask in vision head
* Siglip v1: remove double transpose in FA2
* Update modular file
* Update FA2 test
* Update expected logits
* Fix interpolation for siglip2 image processor
* Skip init test
* Skip dispatch on flash test
* Fix modeling tests
* Fixup
* Add dummy objects
* Fix some docstrings
* Add siglip2 in index.md
* Fix consistency
* Add docs
* Remove size and data format
* Add image processor tests
* Fix
* Add fast image processor
* Fix style
* Fix
* Docs
* Set lowercase for tokenizer
* Adjust head size for Siglip v1
* Update siglip2 for consistency with siglip1
* Update siglip2 conversion
* Update pipeline
* Update checkpoints in tests
* Update checkpoint name
* Fix pooling for image classification model
* Fix FA2 test
* Update processor
* Fix check repo
* Update docs
* Fix typos
* Fix docstring for fast image processor
* Add siglip2 to FA2 docs
* Fix fast ip tests
* Fix constitency
* Fix tokenizer class for siglip v1
* Fix missing header
* Refactor scaling for clip, siglip, siglip2
* Remove unused imports
* Make fast IP default for siglip2
* Update docs
* Update checkpoints
* Update modular
* Update paper link
* Fixup
* Fix name in toctree
* Fix test
2025-02-21 09:04:19 +00:00