Skip to content

Commit f5b5aad

Browse files
Merge pull request #80 from graphcore-research/pypi
Switch to pyproject.toml
2 parents 1edf205 + 161b245 commit f5b5aad

File tree

16 files changed

+85
-46
lines changed

16 files changed

+85
-46
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
*
2-
!requirements*.txt
2+
!requirements-dev.txt

.github/workflows/ci.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ jobs:
1818
- name: Checkout code
1919
uses: actions/checkout@v3
2020

21-
- name: Build Docker Image
22-
run: |
23-
docker build -t unit-scaling-dev:latest .
21+
- name: Build Docker image
22+
run: docker build -t unit-scaling-dev:latest .
23+
24+
- name: Local unit_scaling install
25+
run: docker run -v $(pwd):/home/developer/unit-scaling unit-scaling-dev:latest pip install --user -e .
2426

2527
- name: Run CI
26-
run: docker run --rm -v $(pwd):/home/developer/unit-scaling unit-scaling-dev:latest ./dev ci
28+
run: docker run -v $(pwd):/home/developer/unit-scaling unit-scaling-dev:latest ./dev ci
2729

2830
- name: Publish documentation
2931
if: ${{github.ref == 'refs/heads/main'}}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ __pycache__
77
.venv
88
.venvs
99
.vscode
10+
unit_scaling/_version.py
1011

1112
/build
1213
/dist

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ENV PATH="$PATH:/home/$USERNAME/.local/bin" \
3131

3232
# Install Python dependencies
3333
COPY requirements-dev.txt .
34-
RUN pip install -r requirements-dev.txt
34+
RUN pip install --user -r requirements-dev.txt
3535

3636
# Creates basic .zshrc
3737
RUN sudo cp /etc/zsh/newuser.zshrc.recommended /home/$USERNAME/.zshrc

MANIFEST.in

Lines changed: 0 additions & 1 deletion
This file was deleted.

NOTICE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Copyright (c) 2023 Graphcore Ltd. Licensed under the Apache 2.0 License.
22

33
The included code is released under an Apache 2.0 license, (see [LICENSE](LICENSE)).
44

5-
Our dependencies are (see [requirements.txt](requirements.txt)):
5+
Our dependencies are (see [pyproject.toml](pyproject.toml)):
66

77
| Component | About | License |
88
| --- | --- | --- |

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Unit-Scaled Maximal Update Parameterization (u-μP)
22

3+
[![tests](https://github.com/graphcore-research/unit-scaling/actions/workflows/ci.yaml/badge.svg)](https://github.com/graphcore-research/unit-scaling/actions/workflows/ci-public.yaml)
4+
![PyPI version](https://img.shields.io/pypi/v/unit-scaling)
5+
[![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/graphcore-research/unit-scaling/blob/main/LICENSE)
6+
[![GitHub Repo stars](https://img.shields.io/github/stars/graphcore-research/unit-scaling)](https://github.com/graphcore-research/unit-scaling/stargazers)
7+
38
A library for unit scaling in PyTorch, based on the paper [u-μP: The Unit-Scaled Maximal Update Parametrization](https://arxiv.org/abs/2407.17465) and previous work [Unit Scaling: Out-of-the-Box Low-Precision Training](https://arxiv.org/abs/2303.11257).
49

510
Documentation can be found at
@@ -14,7 +19,12 @@ We're keen to help users with any problems they encounter.
1419
To install the `unit-scaling` library, run:
1520

1621
```sh
17-
pip install git+https://github.com/graphcore-research/unit-scaling.git
22+
pip install unit-scaling
23+
```
24+
or for a local editable install (i.e. one which uses the files in this repo), run:
25+
26+
```sh
27+
pip install -e .
1828
```
1929

2030
## Development

dev

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ def format(check: bool) -> None:
8585
def copyright() -> None:
8686
"""check for Graphcore copyright headers on relevant files"""
8787
command = (
88-
f"find {' '.join(PYTHON_ROOTS)} -type f"
89-
" -not -name *.pyc -not -name *.json -not -name .gitignore"
88+
f"find {' '.join(PYTHON_ROOTS)} -type f -not -name *.pyc -not -name *.json"
89+
" -not -name .gitignore -not -name *_version.py"
9090
" | xargs grep -L 'Copyright (c) 202. Graphcore Ltd[.] All rights reserved[.]'"
9191
)
9292
print(f"$ {command}", file=sys.stderr)

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ To install :code:`unit-scaling`, run:
1818

1919
.. code-block::
2020
21-
pip install git+https://github.com/graphcore-research/unit-scaling.git
21+
pip install unit-scaling
2222
2323
Getting Started
2424
---------------

docs/user_guide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ To install the :code:`unit-scaling` library, run:
1919

2020
.. code-block::
2121
22-
pip install git+https://github.com/graphcore-research/unit-scaling.git
22+
pip install unit-scaling
2323
2424
For those who wish to develop on the :code:`unit-scaling` codebase, clone or fork our
2525
`GitHub repo <https://github.com/graphcore-research/unit-scaling.git>`_ and follow the

0 commit comments

Comments
 (0)