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

migrate ETS to C++ #757

Merged
merged 50 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
729c08d
initial work
jmoralez Jan 11, 2024
43c2b1f
add vscode settings
jmoralez Jan 11, 2024
4c17ad9
export all fns
jmoralez Jan 12, 2024
3997eae
setup pyproject
jmoralez Jan 12, 2024
08dd70d
export ets update
jmoralez Jan 15, 2024
8f3d3f6
remove copies in target fn evaluation
jmoralez Jan 15, 2024
3c3090e
add export for windows
jmoralez Jan 15, 2024
37a28ec
move previous results to utils. lint
jmoralez Jan 15, 2024
2f9fa02
merge main
jmoralez Jan 15, 2024
3beca1f
use ninja instead of make
jmoralez Jan 15, 2024
c38e2df
restore restrict_to_bounds. build wheels in ci
jmoralez Jan 15, 2024
e6b9eb6
move python package to separate folder
jmoralez Jan 16, 2024
39fa3da
restore python versions
jmoralez Jan 16, 2024
4dc2e12
add fugue to local env
jmoralez Jan 17, 2024
6d0915e
publish wheels to s3
jmoralez Jan 19, 2024
9b40f9e
set pyversion as str
jmoralez Jan 19, 2024
4a8fb8b
remove acl
jmoralez Jan 19, 2024
fb6599a
add update_index
jmoralez Jan 19, 2024
9226a2b
clone repo
jmoralez Jan 19, 2024
b4dac84
move cibw config to pyproject. build for linux arm64. update python p…
jmoralez Jan 22, 2024
a6646e9
update installation instructions
jmoralez Jan 22, 2024
70972a3
Merge branch 'main' into ets-cpp
jmoralez Jan 22, 2024
1372d0d
skip all wheel tests
jmoralez Jan 22, 2024
aba8191
Merge branch 'main' into ets-cpp
jmoralez Jan 22, 2024
2762eae
upper bound for pandas
jmoralez Jan 22, 2024
8c8b71b
publish nightly wheels only on push
jmoralez Jan 22, 2024
92fb190
migrate to nanobind
jmoralez Jun 16, 2024
459756c
small updates
jmoralez Jun 16, 2024
6cbd68c
migrate to pybind11
jmoralez Aug 27, 2024
4cf856b
enhancements
jmoralez Aug 27, 2024
7665312
merge main
jmoralez Aug 27, 2024
e144f98
fixes
jmoralez Aug 27, 2024
73eae80
deps fixes
jmoralez Aug 27, 2024
4d5459c
define all extra
jmoralez Aug 27, 2024
348b937
change matrix
jmoralez Aug 27, 2024
c49bd1b
rename
jmoralez Aug 27, 2024
ffab27e
restore archs
jmoralez Aug 27, 2024
8a1f0f3
run tests on built wheels
jmoralez Aug 27, 2024
37a93c3
unique name for artifacts
jmoralez Aug 27, 2024
54ab5cb
fix artifact download
jmoralez Aug 27, 2024
136f99e
return tuple from optim. pin ray to py<312
jmoralez Aug 28, 2024
f1891aa
move pins to ray
jmoralez Aug 28, 2024
1e2e764
remove verbosity
jmoralez Aug 28, 2024
cabfd35
try relative import
jmoralez Aug 28, 2024
f266219
use setuptools
jmoralez Aug 29, 2024
c4064fb
fix extras
jmoralez Aug 29, 2024
4fc8c93
reduce cibw verbosity
jmoralez Aug 29, 2024
ad40127
skip less tests on local tests
jmoralez Aug 29, 2024
71cf866
update contributing
jmoralez Aug 29, 2024
e7bfc44
update python-publish
jmoralez Aug 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
steps:
- name: Clone repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: "true"
- name: Clone docs repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
Expand Down
119 changes: 111 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,46 +14,138 @@ env:
NIXTLA_NUMBA_CACHE: "1"

jobs:
build_wheels:
name: Build wheels for cp${{ matrix.python-version }}-${{ matrix.os-platform[1] }}
runs-on: ${{ matrix.os-platform[0] }}
strategy:
fail-fast: false
matrix:
python-version: [38, 39, 310, 311, 312]
os-platform:
[
[ubuntu-latest, manylinux_x86_64],
[ubuntu-latest, manylinux_aarch64],
[windows-latest, win_amd64],
[macos-12, macosx_x86_64],
[macos-14, macosx_arm64],
]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: "true"

- name: Set up QEMU
if: matrix.os-platform[1] == 'manylinux_aarch64'
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
with:
platforms: arm64

- name: Build wheels
uses: pypa/cibuildwheel@bd033a44476646b606efccdd5eed92d5ea1d77ad # v2.20.0
env:
CIBW_BUILD: cp${{ matrix.python-version }}-${{ matrix.os-platform[1] }}

- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: artifact-cp${{ matrix.python-version }}-${{ matrix.os-platform[1] }}
path: wheelhouse/*.whl
retention-days: 1

publish-nightly-wheels:
if: github.event_name == 'push'
needs: [build_wheels]
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_NIXTLA_PACKAGES }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_NIXTLA_PACKAGES }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Download wheels
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
path: dist
pattern: "artifact-*"
merge-multiple: true

- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: "3.10"

- name: Publish wheels
run: |
pip install awscli beautifulsoup4
aws s3 cp s3://nixtla-packages/statsforecast/index.html .
python action_files/update_index.py
aws s3 sync dist s3://nixtla-packages/statsforecast/

run-local-tests:
runs-on: windows-latest
needs: [build_wheels]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
os: [macos-13, macos-14, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Clone repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: "true"

- name: Set up environment
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: ${{ matrix.python-version }}

- name: Install pip requirements
run: pip install uv && uv pip install --system ".[dev,plotly]"
run: pip install uv && uv pip install --system -r setup.py --extra dev --extra plotly

- name: Download wheels
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
path: dist
pattern: "artifact-*"
merge-multiple: true

- name: Install the library
run: pip install --no-index --find-links dist statsforecast

- name: Run local tests
run: nbdev_test --skip_file_re '(models|distributed|ets|prophet).*.ipynb' --pause 1.0 --do_print --timing
run: nbdev_test --skip_file_re '(distributed|prophet).*.ipynb' --pause 1.0 --do_print --timing

run-tests:
runs-on: ${{ matrix.os }}
needs: [build_wheels]
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Clone repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: "true"

- name: Set up environment
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: ${{ matrix.python-version }}

- name: Install pip requirements
run: pip install uv && uv pip install --system ".[all]"
run: pip install uv && uv pip install --system -r setup.py --extra all

- name: Download wheels
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
path: dist
pattern: "artifact-*"
merge-multiple: true

- name: Install the library
run: pip install --no-index --find-links dist statsforecast

- name: Run tests
run: nbdev_test --skip_file_re '(distributed|prophet).*.ipynb' --pause 1.0 --do_print --timing
Expand All @@ -64,6 +156,7 @@ jobs:
pytest --durations=0 action_files

test-m3-performance:
needs: [build_wheels]
runs-on: ubuntu-latest
steps:
- name: Clone repo
Expand All @@ -74,8 +167,18 @@ jobs:
with:
python-version: "3.10"

- name: Install library and extra deps
run: pip install uv && uv pip install --system ".[dev]"
- name: Install pip requirements
run: pip install uv && uv pip install --system -r setup.py --extra dev

- name: Download wheels
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
path: dist
pattern: "artifact-*"
merge-multiple: true

- name: Install the library
run: pip install --no-index --find-links dist statsforecast

- name: Run M3 experiment
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
- name: Set up python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: '3.10'
python-version: "3.10"

- name: Install linters
run: pip install black nbdev pre-commit
run: pip install black 'nbdev<2.3.26' pre-commit

- name: Run pre-commit
run: pre-commit run --files statsforecast/*
run: pre-commit run --files python/statsforecast/*
78 changes: 65 additions & 13 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,77 @@
name: Upload Python Package

on:
release:
types: [published]
push:
tags: ["v*"]

jobs:
deploy:
build_wheels:
name: Build wheels for cp${{ matrix.python-version }}-${{ matrix.os-platform[1] }}
runs-on: ${{ matrix.os-platform[0] }}
strategy:
fail-fast: false
matrix:
python-version: [38, 39, 310, 311, 312]
os-platform:
[
[ubuntu-latest, manylinux_x86_64],
[ubuntu-latest, manylinux_aarch64],
[windows-latest, win_amd64],
[macos-12, macosx_x86_64],
[macos-14, macosx_arm64],
]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: "true"

- name: Set up QEMU
if: matrix.os-platform[1] == 'manylinux_aarch64'
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
with:
platforms: arm64

- name: Build wheels
uses: pypa/cibuildwheel@bd033a44476646b606efccdd5eed92d5ea1d77ad # v2.20.0
env:
CIBW_BUILD: cp${{ matrix.python-version }}-${{ matrix.os-platform[1] }}

- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: artifact-cp${{ matrix.python-version }}-${{ matrix.os-platform[1] }}
path: wheelhouse/*.whl
retention-days: 1

build_sdist:
name: Build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: "3.10"

- name: Build sdist
run: |
python -m pip install build
python -m build --sdist --outdir dist

- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
path: dist/*.tar.gz

upload_to_pypi:
name: Upload to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
permissions:
id-token: write

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
python-version: '3.10'
- name: Install dependencies
run: python -m pip install build wheel
- name: Build package
run: python -m build -sw
- name: Publish package
name: artifact
path: dist

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ nbs/.last_checked
.idea
mlruns/
.luarc.json
*.so
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "external_libs/eigen"]
path = external_libs/eigen
url = https://gitlab.com/libeigen/eigen
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"editor.formatOnSave": true,
"C_Cpp.formatting": "clangFormat",
"C_Cpp.clang_format_sortIncludes": true,
"C_Cpp.default.cppStandard": "c++17"
}
Loading
Loading