Commit graph

31 commits

Author SHA1 Message Date
Oleksandr Shchur
47be457206 Use typing_extensions for NotRequired 2026-02-20 17:06:04 +00:00
Abdul Fatir
a942c0609c
Update peft version constraint in pyproject.toml 2025-11-28 00:08:38 +01:00
Abdul Fatir
c5907ef52e
Chronos-2: Add LoRA fine-tuning support (#393)
*Issue #, if available:*

*Description of changes:* Adds support for LoRA fine-tuning.

- [x] Move peft/pandas dependency to an extra
- [x] Add tests for LoRA
- [x] Update notebook with LoRA info
- [x] Enable automatic recognition and loading of LoRA adapters


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
2025-11-25 16:06:58 +01:00
Abdul Fatir
182aafe184
Update torch dependency version to >=2.2,<3 (#388)
*Issue #, if available:*

*Description of changes:*


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
2025-11-21 11:37:14 +01:00
Abdul Fatir
93419cfe9f
Relax transformers lower bound to >=4.41 (#364) 2025-11-05 14:27:46 +01:00
Abdul Fatir
7a8427d18e
Bump version to 2.0.0 (#323)
*Issue #, if available:*

*Description of changes:* Bump to 2.0


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
2025-10-20 15:23:23 +02:00
Abdul Fatir
48cdf1f7f6
Use dynamic versioning and bump version (#320)
⚠️ Must be merged after #319 and other related PRs.

*Issue #, if available:*

*Description of changes:* Exports `chronos.__version__` and uses it
dynamically in `pyproject.toml`. Bumps version to 2.0.0.


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
2025-10-20 12:04:04 +02:00
Abdul Fatir
15ffe8835d
Add Chronos-2 (#319)
*Issue #, if available:*

*Description of changes:* This PR adds the Chronos-2 model.

* Chronos-2 modeling and pipeline code, including tests.
* Updated `pyproject.toml`. Merge `training` and `evaluation` extras
into a single `dev` extra. This stuff is only relevant for the Chronos
models.
* Added `predict_fev` to `BaseChronosPipeline`.
* Changes to `InstanceNorm` for Chronos-Bolt to make it general and
compatible with Chronos-2.
* Minor renaming and polishing in the inference code for Chronos and
Chronos-Bolt.

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

---------

Co-authored-by: Oleksandr Shchur <oleks.shchur@gmail.com>
2025-10-20 10:34:20 +02:00
Abdul Fatir
fcd09fe8b6
Fix issue with new caching mechanism in transformers and bump versions (#313)
*Issue #, if available:* Fixes #310 and closes #302

*Description of changes:* This PR fixes an issue related to the new
caching mechanism for T5 introduced in `transformers==4.54`. [Prior
versions
set](https://github.com/huggingface/transformers/blob/v4.53.3/src/transformers/models/t5/modeling_t5.py#L1328)
`encoder_config.is_encoder_decoder = False` when initializing encoder
and decoder. Following transformers, we also initialized Chronos-Bolt in
the same way. However, in v4.54 this line [has been
removed](3fd456b200/src/transformers/models/t5/modeling_t5.py (L1301))
and [new logic has been
added](3fd456b200/src/transformers/models/t5/modeling_t5.py (L494))
which relies on `is_encoder_decoder` [being
True](3fd456b200/src/transformers/models/t5/modeling_t5.py (L1007)).
This causes Chronos-Bolt to break as described in #310. This PR removes
`is_encoder_decoder = False` for both encoder and decoder which fixes
the issue. I re-ran our mini eval in the CI and got the same results for
v4.54 and v4.48 (our current lower bound).

This PR also bumps package versions. 


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
2025-08-05 10:46:12 +02:00
Abdul Fatir
6a9c8dadac
Bump version to 1.5.2 (#299)
*Issue #, if available:*

*Description of changes:*


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
2025-05-06 10:20:46 +02:00
Tyler
c5880604df
Bump accelerate>=0.32,<2 (#298)
*Issue #, if available:*

*Description of changes:*

Just increased the max version allowed. Tests pass.

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

---------

Co-authored-by: Abdul Fatir <Abdulfatirs@gmail.com>
2025-05-06 10:15:22 +02:00
Lorenzo Stella
f40a266a55
Fix type-checking issues (#295)
*Issue #, if available:* See example build
https://github.com/amazon-science/chronos-forecasting/actions/runs/14302765904/job/40313421985

*Description of changes:*
- Address type-checker complaints, where possible
- Bump bugfix version of the package


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
2025-04-10 17:23:59 +02:00
Lorenzo Stella
8178798f4e
Bump transformers to >=4.48 (#280)
*Issue #, if available:* addresses
https://github.com/amazon-science/chronos-forecasting/security/dependabot/1

*Description of changes:*


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
2025-02-13 13:46:47 +01:00
Lorenzo Stella
73d6c9aa1a
Bump package version to 1.5.0 (#278)
*Issue #, if available:*

*Description of changes:*


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
2025-02-06 16:37:26 +01:00
Lorenzo Stella
75803f241f
Relax torch compatibility to <3 (#277)
*Issue #, if available:* Solves #273

*Description of changes:*


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
2025-02-06 16:29:32 +01:00
Lorenzo Stella
133761a901
Bump version number to 1.4.1 (#228)
By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
2024-12-04 18:35:22 +01:00
Abdul Fatir
47cac082c1
Bump version to 1.4.0 (#225)
*Issue #, if available:*

*Description of changes:* Title.


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

Co-authored-by: Abdul Fatir Ansari <ansarnd@amazon.de>
2024-12-02 12:02:20 +01:00
Abdul Fatir
ebaa13cbf0
Update project information and workflows (#214)
*Description of changes:* This PR updates project information and
workflows to allow for PyPi release.


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

---------

Co-authored-by: Abdul Fatir Ansari <ansarnd@amazon.de>
2024-11-28 13:37:58 +01:00
Abdul Fatir
72ab64166c
Add support for Chronos-Bolt models (#204)
*Issue #, if available:* N/A

*Description of changes:* This PR adds support for Chronos-Bolt models.

TODOs:

- [x] Update evaluation script
- [x] Fix and add tests for Bolt
- [x] Update docstrings
- [x] Update README example and mention Chronos-Bolt
- [x] Update results bar plot in README
- [x] Add versions for libraries in `pyproject.toml`
- [x] Check that the training and eval scripts work
- [x] Change `autogluon` -> `amazon` in model names

Post Merge:
- [ ] Update Citation style in README, both Github and HuggingFace repos
- [ ] Remove note about AutoGluon
- [ ] Update READMEs of original Chronos models to refer to Chronos-Bolt

NOTE: To be merged after Chronos-Bolt models are available under the
`amazon` namespace on HF.

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

---------

Co-authored-by: Abdul Fatir Ansari <ansarnd@amazon.de>
Co-authored-by: Caner Turkmen <turkmen.ac@gmail.com>
Co-authored-by: Lorenzo Stella <stellalo@amazon.com>
2024-11-26 17:47:14 +01:00
Alvaro Perez-Diaz
ac6ee36ace
Fix number of quantisation buckets (#182)
Fixes https://github.com/amazon-science/chronos-forecasting/issues/181.

Chronos' tokenizer has a vocabulary size of `n_tokens`. Among these,
there are `n_special_tokens` reserved for EOS, PAD, etc. and `n_tokens -
n_special_tokens` allocated to numerical values. However, the provided
`MeanScaleUniformBins` tokenizer creates` n_tokens - n_special_tokens +
1` different buckets, resulting in a total of `n_tokens + 1` possible
tokens. This causes training and inference errors when one of the data
points gets allocated to the largest bucket, as the model requires 0 <=
token_id < n_tokens.

This PR modifies the `MeanScaleUniformBins` tokenizer, so that it
creates one less bucket for numerical values.

---

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

---------

Co-authored-by: Lorenzo Stella <lorenzostella@gmail.com>
2024-10-04 23:00:42 +02:00
Abdul Fatir
fead4ecbca
Add evaluation script (#134)
*Description of changes:* This PR adds configs and a script to evaluate
Chronos models in the same way as described in the paper.


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

Co-authored-by: Abdul Fatir Ansari <ansarnd@amazon.de>
2024-06-27 17:13:35 +02:00
Lorenzo Stella
0ea0adb9b3
Uncap transformers dependency (#94)
*Issue #, if available:* We had to cap transformers in #77 due to
https://github.com/huggingface/transformers/issues/30892. The issue was
solved and released in [transformers
4.41.1](https://github.com/huggingface/transformers/releases/tag/v4.41.1).

*Description of changes:* Remove previous version cap introduced in #77.


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
2024-06-03 09:14:07 +02:00
Abdul Fatir
ea26e3d7a7
Relax torch and transformers versions (#81)
*Description of changes:* This PR relaxes `torch` and `transformers`
versions to allow for older versions that were used during original
training. This is needed in light of recent `torch`/`transformers`
versions being slower with DDP.

Relevant issues (but the problem may be deeper than these):

- https://github.com/huggingface/transformers/issues/30840
- https://github.com/pytorch/pytorch/issues/127077
- https://github.com/NVIDIA/nccl/issues/1298


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

Co-authored-by: Abdul Fatir Ansari <ansarnd@amazon.com>
2024-05-27 13:54:53 +02:00
Lorenzo Stella
55166d3227
Cap transformers <4.41 (#77)
*Issue #, if available:* #76

*Description of changes:* transformers 4.41 broke something for us, we
need to look into it deeper


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
2024-05-18 06:53:40 +02:00
Abdul Fatir
7a019b3432
Update README and bump version (#74)
Adds news about the fix to tokenizer `output_transform`.

Co-authored-by: Abdul Fatir Ansari <ansarnd@amazon.com>
2024-05-17 15:38:42 +02:00
Abdul Fatir
1e102f6989
Merge kernel-synth extra into training (#66)
*Description of changes:* See title. 


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

Co-authored-by: Abdul Fatir Ansari <ansarnd@amazon.com>
2024-05-10 14:08:37 +02:00
Abdul Fatir
ecfabdbfd6
Add KernelSynth script (#64)
*Description of changes:* This PR adds the script to generate synthetic
data from KernelSynth.


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

---------

Co-authored-by: Abdul Fatir Ansari <ansarnd@amazon.com>
2024-05-09 23:01:46 +02:00
Lorenzo Stella
b4e8085c7f
Add training script (#63)
*Description of changes:* Add training script and config files. Can be
used for pre-training, or adapted for fine-tuning chronos models.


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

---------

Co-authored-by: Abdul Fatir <Abdulfatirs@gmail.com>
2024-05-09 17:52:01 +02:00
Lorenzo Stella
4b1d1c818b
Fix types, add mypy to workflow (#42)
*Description of changes:* Fix some type checking issues, add mypy to
github workflow, apply black


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
2024-04-05 15:36:39 +02:00
Lorenzo Stella
b4a6c0c2eb
Bump package version to 1.1 (#27)
By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
2024-03-25 13:23:08 +01:00
Lorenzo Stella
7ba945c995 Upload code 2024-03-13 09:58:39 +01:00