Commit Graph

15053 Commits

Author SHA1 Message Date
John Giorgi
fde22c75a1
Add summarization name mapping for MultiNews (#18117)
* Add summarization name mapping for MultiNews

* Add summarization name mapping for MultiNews
2022-07-13 08:19:20 -04:00
Sebastian Sosa
195133363e
supported python versions reference (#18116)
* supported python versions reference

* Update CONTRIBUTING.md

removing commit hash from link

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-07-13 08:18:44 -04:00
Joao Gante
20509ab0e0
TF: unpack_inputs decorator independent from main_input_name (#18110) 2022-07-13 10:43:41 +01:00
Joao Gante
fcefa200b2
TF: remove graph mode distinction when processing boolean options (#18102) 2022-07-12 19:05:31 +01:00
Niklas Muennighoff
bc34c21191
Fix BLOOM dtype (#17995)
* Add fp16 option

* Fix BLOOM dtype

* Formatting

* Remove torch_dtype arg

* Revert formatting

* Apply formatting

* Add n_embed backward compat
2022-07-12 10:36:08 -04:00
Joao Gante
981714efe1
CLI: reenable pt_to_tf test (#18108) 2022-07-12 13:38:05 +01:00
wei zhao
f5221c06e4
Report value for a step instead of epoch. (#18095)
* Report value for a step instead of epoch.

Report an objective function value for a step instead of epoch to optuna.
I made this modification for the following reason:
If "eval_steps" is less than steps per epoch, there maybe warnings like this: "optuna/trial/_trial.py:592: UserWarning: The reported value is ignored because this `step` 0 is already reported.". So "step" are more appropriate than "epoch" here.

* MOD: make style.

Co-authored-by: zhaowei01 <zhaowei01@yuanfudao.com>
2022-07-12 08:18:35 -04:00
Sijun He
d4ebd4e112
speed up test (#18106) 2022-07-12 04:28:28 -04:00
jianan-gu
b7d8bd378c
Enhance IPEX integration in Trainer (#18072)
* enhance ipex import

* refine codes

* refine style

* add link

* style

Co-authored-by: Stas Bekman <stas@stason.org>
2022-07-11 21:34:09 -07:00
Younes Belkada
a462fc9232
Bloom Optimize operations (#17866)
* fix tolerance for a bloom slow test

* enhance alibi padding

- get rid of for loops
- deals better with padded batched input
- avoid useless cpu/gpu communication when creating alibi

Co-authored-by: justheuristic <justheuristic@gmail.com>

* optimize attention mask

* fix scaled softmax limit values

* optimize building alibi tensor

Co-authored-by: Younes Belkada <younesbelkada@users.noreply.github.com>

* fix attention_mask shape when it's None

* minor fixes

- fix docstring + arg names

* remove colons in docstring

* Apply suggestions from code review

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>

* apply suggestion

* remove unsued arg

* refactor a bit

- use [:, None] for consistency

* refactor attention block

Co-authored-by: Nouamane Tazi <nouamane98@gmail.com>

* quick fixes

* first attempt

* refactor attention block and fix all tests except "test_simple_generation"

- added comments to better explain attention block

* remove debug lines and add TODO comment

* change `torch.bmm` to `torch.baddbmm`
- fixes `test_simple_generation`but breaks `test_batch_generation_padd`

* styling

* all tests are passing now
- use `bmm`
- add explanation for `allow_fp16_reduced_precision_reduction`

Co-authored-by: Younes Belkada <younesbelkada@users.noreply.github.com>

* styling

Co-authored-by: Younes Belkada <younesbelkada@users.noreply.github.com>

* fix support for accelerate

Co-authored-by: Younes Belkada <younesbelkada@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* remove attn softmax in fp32

* refactor comments

* refactor a bit

- remove warning message
- remove print on test

* refer to pytorch t5

* change the slow tests

- do the tests in fp32
- remove some comments
- keep large comments

* update expected output for `test_simple_generation`
- we now test using fp32

* make style + change comments a bit

* fix dtype padd test

Co-authored-by: justheuristic <justheuristic@gmail.com>
Co-authored-by: Nouamane Tazi <nouamane98@gmail.com>
Co-authored-by: Younes Belkada <younesbelkada@users.noreply.github.com>
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-07-11 13:16:13 -04:00
Sylvain Gugger
5ff6f853d7 Mark slow test as such 2022-07-11 12:48:57 -04:00
Sylvain Gugger
b1b8222d80
Add filename to info diaplyed when downloading things in from_pretrained (#18099) 2022-07-11 12:45:06 -04:00
Sylvain Gugger
6c8017a5c8
Fix image segmentation and object detection pipeline tests (#18100) 2022-07-11 12:41:56 -04:00
Sylvain Gugger
b0520f594c Skip failing tests 2022-07-11 10:16:54 -04:00
Duong A. Nguyen
1e8140caad
Fix RESOURCE_EXHAUSTED error when dealing with large datasets in Flax example scripts (#18069)
* Fix RESOURCE_EXHAUSTED error for large datasets on Flax example scripts

* using np.permutation for creating batch_idx

* train_samples_idx -> training_samples_idx

* fix type hints
2022-07-11 15:59:08 +02:00
Yih-Dar
ac98a88fbc
Fix torchscript tests for GPT-NeoX (#18012)
* fix dtype issue in _attn

* fix RotaryEmbedding

* fix RotaryEmbedding 2

* clean up

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-07-11 05:02:54 -04:00
Yulv-git
95113d1365
Fix some typos. (#17560)
* Fix some typos.

Signed-off-by: Yulv-git <yulvchi@qq.com>

* Fix typo.

Signed-off-by: Yulv-git <yulvchi@qq.com>

* make fixup.
2022-07-11 05:00:13 -04:00
Stas Bekman
ad28ca291b
[bloom] fix alibi device placement (#18087) 2022-07-10 09:11:46 -07:00
neverix
8b332a6a16
Make predict() close progress bars after finishing (#17952) (#18078)
* Make Trainer.predict call on_evaluate (#17952)

* Add on_predict

* Small fix

* Small and different fix

* Add tests
2022-07-08 16:44:24 -04:00
Sylvain Gugger
7c046c5c22
Update localized READMES when template is filled. (#18062) 2022-07-08 11:08:52 -04:00
BOSEOP KIM
94ca7d2faa
Fix type issue in using bucketing with Trainer (#18051)
* Fix type issue in using bucketing with Trainer

- Fix type issues in LengthGrouperSampler,
  DistributedLengthGroupedSampler

refs: #18003

* Change logging type in LengthGroupedSampler

- Change `logger.warning` to `logger.info`

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* Change logging type in DistributedLengthGroupedSampler

- Change `logger.warning` to `logger.info`

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* Remove adundant clause in LengthGroupedSampler

- Use `elif`

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* Remove adundant clause in DistributedLengthGroupedSampler

- Use `elif`

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* Apply black, isort to modified codes in the script

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-07-08 11:06:00 -04:00
Sylvain Gugger
9bd3968509
Fix slow CI by pinning resampy (#18077)
* Fix slow CI by pinning resampy

* Actually put it in the speech dependencies
2022-07-08 10:51:24 -04:00
Matt
de46cde14b
Drop columns after loading samples in prepare_tf_dataset (#17967)
* Drop columns after loading samples, rather than before, to avoid breaking transforms

* make fixup

* Add workaround so this PR can work with current datasets version
2022-07-07 18:02:22 +01:00
Patrick von Platen
2544c1434f
[Generate Tests] Make sure no tokens are force-generated (#18053) 2022-07-07 15:08:34 +02:00
varshith
91c4a3ab1a
Added Command for windows VENV activation in installation docs (#18008)
* Added command for windows VENV activation

* changed linux and macos  specification
2022-07-07 08:18:44 -04:00
Sylvain Gugger
1b749a7f8d
Sort doc toc (#18034)
* Add script to sort doc ToC

* Style and fixes

* Add check to quality job
2022-07-07 08:17:58 -04:00
Sylvain Gugger
1b5ea74783
Place inputs on device when include_inputs_for_metrics is True (#18046) 2022-07-07 08:17:49 -04:00
Sylvain Gugger
870ff9e1da Skip failing test until @gante fix it. 2022-07-06 15:13:28 -04:00
Sylvain Gugger
2e90c3df8f
Doc to dataset (#18037)
* Link to the Datasets doc

* Remove unwanted file
2022-07-06 12:10:06 -04:00
Matt
be79cd7d8e
Protect TFGenerationMixin.seed_generator so it's not created at import (#18044) 2022-07-06 16:36:28 +01:00
Joao Gante
360719a6a4
TF: GPT-J compatible with XLA generation (#17986) 2022-07-06 15:02:07 +01:00
ADAning
bf37e5c7f6
Fix T5 incorrect weight decay in Trainer and official summarization example (#18002)
* Add ALL_LAYERNORM_LAYERS for LayerNorm

* fix bug of appending layer norm
2022-07-06 09:44:19 -04:00
NielsRogge
22edb68d49
Squash commits (#17981)
Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
2022-07-06 08:11:48 -04:00
Yih-Dar
f681437203
Enable Past CI (#17919)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-07-05 18:08:36 +02:00
Matt
5ae087cf8e
Fix T5/mT5 tests (#18029) 2022-07-05 16:22:03 +01:00
Sanchit Gandhi
ec07eccc7d
[Flax] Bump to v0.4.1 (#17966) 2022-07-05 15:17:17 +01:00
Yih-Dar
97db5b4223
Update expected values in DecisionTransformerModelIntegrationTest (#18016)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-07-05 14:53:43 +02:00
Joao Gante
f0982682bd
TF: T5 can now handle a padded past (i.e. XLA generation) (#17969)
* get the right slicing index for position_bias
2022-07-04 19:47:43 +01:00
Sreyan Ghosh
e3139ad301
fixed calculation of ctc loss in TFWav2Vec2ForCTC (#18014)
Co-authored-by: Sreyan-G@NVIDIA <sreyang@nvidia.com>
2022-07-04 17:36:36 +01:00
Matt
96d833b211
Return scalar losses instead of per-sample means (#18013)
* Return scalar losses instead of per-sample means

* Make loss shape (1,) instead of scalar

* Allow scalar losses in test_loss_computation

* Allow scalar losses in test_loss_computation

* Allow scalar losses in test_loss_computation

* Remove XLA loss function for RAG
2022-07-04 17:26:19 +01:00
Matthijs Hollemans
6cb19540c9
sort list of models (#18011) 2022-07-04 09:20:55 -04:00
regisss
7498db06a1
Replace BloomTokenizer by BloomTokenizerFast in doc (#18005) 2022-07-04 08:40:13 -04:00
regisss
3cfdefaa4d
Fix typo in error message in generation_utils (#18000) 2022-07-04 06:04:58 -04:00
amyeroberts
cf2578ae00
Refactor to inherit from nn.Module instead of nn.ModuleList (#17501)
* Refactor to inherit from nn.Module instead of nn.ModuleList

* Fix typo

* Empty to trigger CI re-run

Blender Bot tests failing (should be unrelated to this PR) and pass locally). I don't have sufficient permisisons to re-run the CI workflow (totally or from failed)
2022-07-04 06:03:42 -04:00
amyeroberts
77ea5130a1
Add TF ResNet model (#17427)
* Rought TF conversion outline

* Tidy up

* Fix padding differences between layers

* Add back embedder - whoops

* Match test file to main

* Match upstream test file

* Correctly pass and assign image_size parameter

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>

* Add in MainLayer

* Correctly name layer

* Tidy up AdaptivePooler

* Small tidy-up

More accurate type hints and remove whitespaces

* Change AdaptiveAvgPool

Use the AdaptiveAvgPool implementation by @Rocketknight1, which correctly pools if the output shape does not evenly divide by input shape c.f. 9e26607e22 (r900109509)

Co-authored-by: From: matt <rocketknight1@gmail.com>
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>

* Use updated AdaptiveAvgPool

Co-authored-by: matt <rocketknight1@gmail.com>

* Make AdaptiveAvgPool compatible with CPU

* Remove image_size from configuration

* Fixup

* Tensorflow -> TensorFlow

* Fix pt references in tests

* Apply suggestions from code review - grammar and wording

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* Add TFResNet to doc tests

* PR comments - GlobalAveragePooling and clearer comments

* Remove unused import

* Add in keepdims argument

* Add num_channels check

* grammar fix: by -> of

Co-authored-by: matt <rocketknight1@gmail.com>

Co-authored-by: Matt <Rocketknight1@users.noreply.github.com>

* Remove transposes - keep NHWC throughout forward pass

* Fixup look sharp

* Add missing layer names

* Final tidy up - remove from_pt now weights on hub

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
Co-authored-by: matt <rocketknight1@gmail.com>
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
Co-authored-by: Matt <Rocketknight1@users.noreply.github.com>
2022-07-04 10:59:15 +01:00
Lysandre Debut
7b18702ca7
Add link to existing documentation (#17931) 2022-07-04 04:13:05 -04:00
Dobatymo
a045cbd6c9
only a stupid typo, but it can lead to confusion (#17930) 2022-07-04 04:04:16 -04:00
David Heryanto
49c8c67fb8
Exclude Databricks from notebook env only if the runtime is below 11.0 (#17988)
* Exclude Databricks from notebook env only if the runtime is below 11.0

* Dummy commit to trigger CI

* Empty commit to trigger CI

* Empty commit to trigger CI

* Empty commit to trigger CI

* Empty commit to trigger CI

* Empty commit to trigger CI

* Empty commit to trigger CI

* Empty commit to trigger CI
2022-07-01 16:17:40 -04:00
seungeunrho
6890d1960f
Shifting labels for causal LM when using label smoother (#17987)
* Shifting labels for causal LM when using label smoother

When training CausalLM, loss is computed within model's foward() function and
labels are shifted internally. However, if label smoothing is applied, loss is
computed in trainer's compute_loss function and labels are not shifted.
This causes unintended confusion during the alignment of labels and corresponding
inputs. This commit is for resolving this confusion.

Resolves #17960

On branch shift_labels_for_causalLM
Changes to be committed:
	modified:   src/transformers/trainer.py
	modified:   src/transformers/trainer_pt_utils.py

* Update trainer.py

* Update src/transformers/trainer.py

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-07-01 14:55:35 -04:00
Yih-Dar
6f0723a9be
Restore original task in test_warning_logs (#17985)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-07-01 20:44:27 +02:00