Skip to content

Commit

Permalink
Merge branch 'development' into factory
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkobronzi authored Nov 7, 2023
2 parents fa99899 + c00ec06 commit df88605
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 43 deletions.
15 changes: 6 additions & 9 deletions APPROVED_LIBRARIES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{%- if cookiecutter.environment == 'mila' %}
__TODO_START__
When starting a project, the other company needs to approve the libraries/tools that we use.
There are two options that the company can choose:
Expand All @@ -10,7 +9,7 @@ If the latter, this file represents the list.

The way it works is the following:
- First, make sure that all the licenses listed below are still valid (i.e., they did not change). You can use the link to speedup this process.
- Note that the last time the list was checked was on 2022-August-12.
- Note that the last time the list was checked was on 2023-April-04.
- Then, ask the company to approve the list by writing "approved" (or similar), with their git account (this will prove that the company approval is authentic).
- When new libraries are added, create a new section below (`Dependencies as of ...`), where you copy the old list and you modify it according to your needs.
- Ask the company to approve with the method above (git commit).
Expand All @@ -23,15 +22,15 @@ Here is the list of dependencies required by Mila for the project development.
Note that the following dependencies will trigger some other dependencies and for sake of simplicity,
we are not listing them all. Modifications since last approved version are in **bold**.

# Dependencies as of {% now 'local', '%Y/%m/%d' %}
# Dependencies as of {PROJECT_START_DATE}

## General dependencies

* Python: [PSF](https://docs.python.org/3/license.html#psf-license) ([Python](https://www.python.org/))
* virtualenv : MIT ([https://pypi.org/project/virtualenv/](https://pypi.org/project/virtualenv/))
* miniconda : 3-clause BSD ([https://docs.conda.io/en/latest/license.html](https://docs.conda.io/en/latest/license.html))
* pip : MIT ([https://en.wikipedia.org/wiki/Pip_(package_manager)](https://en.wikipedia.org/wiki/Pip_(package_manager)))
* Mila cookiecutter : MIT [https:/mila-iqia/cookiecutter-pyml/tree/lightning_and_keras](https:/mila-iqia/cookiecutter-pyml/tree/lightning_and_keras)
* Mila cookiecutter : MIT [https:/mila-iqia/cookiecutter-pyml/blob/development/LICENSE](https:/mila-iqia/cookiecutter-pyml/blob/development/LICENSE)
* ZSH: MIT-like [zsh](http://zsh.sourceforge.net/)
* OH-MY-ZSH: MIT [oh-my-zsh](https:/ohmyzsh/ohmyzsh/)
* TMUX - ISC [tmux](https:/tmux/tmux/)
Expand All @@ -50,20 +49,18 @@ we are not listing them all. Modifications since last approved version are in **
* 'orion', BSD [https:/Epistimio/orion/blob/develop/LICENSE](https:/Epistimio/orion/blob/develop/LICENSE)
* 'pyyaml', MIT ([https://pypi.org/project/PyYAML/](https://pypi.org/project/PyYAML/))
* 'pytest', MIT ([https://pypi.org/project/pytest/](https://pypi.org/project/pytest/))
* 'pytest-cov', BSD (MIT) ([https://pypi.org/project/pytest-cov/](https://pypi.org/project/pytest-cov/))
* 'pytest-cov', MIT ([https://pypi.org/project/pytest-cov/](https://pypi.org/project/pytest-cov/))
* 'pytype', MIT + Apache 2.0, ([https:/google/pytype/](https:/google/pytype/blob/master/LICENSE))
* 'pytorch_lightning', Apache-2.0 ([https://pypi.org/project/pytorch-lightning/](https://pypi.org/project/pytorch-lightning/))
* 'sphinx', BSD ([https://pypi.org/project/Sphinx/](https://pypi.org/project/Sphinx/))
* 'sphinx-autoapi', MIT ([https://pypi.org/project/sphinx-autoapi/](https://pypi.org/project/sphinx-autoapi/))
* 'sphinx-rtd-theme', MIT ([https://pypi.org/project/sphinx-rtd-theme/](https://pypi.org/project/sphinx-rtd-theme/))
* 'sphinxcontrib-napoleon', BSD ([https://pypi.org/project/sphinxcontrib-napoleon/](https://pypi.org/project/sphinxcontrib-napoleon/))
* 'sphinxcontrib-katex', BSD (MIT) ([https://pypi.org/project/sphinxcontrib-katex/](https://pypi.org/project/sphinxcontrib-katex/))
* 'sphinxcontrib-katex', MIT ([https://pypi.org/project/sphinxcontrib-katex/](https://pypi.org/project/sphinxcontrib-katex/))
* 'tensorboard', Apache License 2.0 ([https:/tensorflow/tensorboard](https:/tensorflow/tensorboard))
* 'tqdm', MIT+Mozilla Public license ([https://pypi.org/project/tqdm/](https://pypi.org/project/tqdm/))
* 'torch', BSD-3 ([https://pypi.org/project/torch/](https://pypi.org/project/torch/))
* 'torchvision', BSD, ([https://pypi.org/project/torchvision/](https://pypi.org/project/torchvision/))

## Pre-trained models

* ADD IF USED
{%- endif %}
Add any pre-trained models and associated licenses here if relevant.
81 changes: 49 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,69 @@
# amlrt_project
# AMLRT Cookiecutter - Initialize a new project

First, git clone this project template locally.

Replace this line with a short description about your project!

git clone https:/mila-iqia/cookiecutter-pyml.git

## Instructions to setup the project
Select a name for the new project; in the following we assume that
the name is `${PROJECT_NAME}`. Change it accordingly to the correct name.

### Install the dependencies:
First, activate a virtual environment (recommended).
Install the package in `editable` mode so you can modify the source directly:
Rename your just-cloned folder to the new project name:

pip install -e .
mv cookiecutter-pyml ${PROJECT_NAME}

To add new dependencies, simply add them to the setup.py.
### Add git:
Now go into the project folder and delete the git history.

git init
cd ${PROJECT_NAME}
rm -fr .git

### Setup pre-commit hooks:
These hooks will:
* validate flake8 before any commit
* check that jupyter notebook outputs have been stripped
This is done so that your new project will start with a clean git history.
Now, initialize the repository with git:

cd .git/hooks/ && ln -s ../../hooks/pre-commit .
git init

### Commit the code
And perform the first commit:

git add .
git commit -m 'first commit'

### Link github to your local repository
Go on github and follow the instructions to create a new project.
When done, do not add any file, and follow the instructions to
link your local git to the remote project, which should look like this:
(PS: these instructions are reported here for your convenience.
We suggest to also look at the GitHub project page for more up-to-date info)

git remote add origin [email protected]:{$GITHUB_USERNAME}/amlrt_project.git
git remote add origin [email protected]:${GITHUB_USERNAME}/${PROJECT_NAME}.git
git branch -M main
git push -u origin main

At this point, the local code is versioned with git and pushed to GitHub.
You will not need to use the instructions in this section anymore, so we
suggest to delete this section ("AMLRT Cookiecutter - Initialize a new project") entirely.
(by doing so it will be clear that the initialization has been already done,
and all you need from now on is just to git clone from the repository you
just pushed, i.e., `[email protected]:${GITHUB_USERNAME}/${PROJECT_NAME}.git`).

# amlrt_project (change this name to the name of your project)

Replace this line with a short description about your project!

## Instructions to setup the project

### Install the dependencies:
First, activate a virtual environment (recommended).
Install the package in `editable` mode so you can modify the source directly:

pip install -e .

To add new dependencies, simply add them to the setup.py.

### Setup pre-commit hooks:
These hooks will:
* validate flake8 before any commit
* check that jupyter notebook outputs have been stripped

cd .git/hooks/ && ln -s ../../hooks/pre-commit .

### Setup Continuous Integration

Continuous integration will run the following:
Expand All @@ -48,23 +72,13 @@ Continuous integration will run the following:
- `flake8` to check the code syntax.
- Checks on documentation presence and format (using `sphinx`).

We support the following Continuous Integration providers.
Check the following instructions for more details.

#### GitHub Actions
We support the GitHub Actions for running CI.

Github actions are already configured in `.github/workflows/tests.yml`.
Github actions are already enabled by default when using Github, so, when
pushing to github, they will be executed automatically for pull requests to
`main` and to `develop`.

#### Azure

Azure Continuous Integration is already configured in (`.azure_pipeline.yml`).

To enable it server-side, just in azure and select `.azure_pipeline.yml` as the
configuration one for Continuous Integration.

## Running the code

### Run the tests
Expand Down Expand Up @@ -110,7 +124,7 @@ First, bring you project on the cluster (assuming you didn't create your
project directly there). To do so, simply login on the cluster and git
clone your project:

git clone [email protected]:<$GITHUB_USERNAME>/amlrt_project.git
git clone [email protected]:${GITHUB_USERNAME}/${PROJECT_NAME}.git

Then activate your virtual env, and install the dependencies:

Expand Down Expand Up @@ -143,7 +157,10 @@ To get a sumary for a particular tag, just run:

#### GPU profiling on the Mila cluster

It can be useful to monitor and profile how you utilise your GPU (usage, memory, etc.). For the time being, you can only monitor your profiling in real-time from the Mila cluster, i.e. while your experiments are running. To monitor your GPU, you need to setup port-forwarding on the host your experiments are running on. This can be done in the following way:
It can be useful to monitor and profile how you utilise your GPU (usage, memory, etc.). For the
time being, you can only monitor your profiling in real-time from the Mila cluster, i.e. while your
experiments are running. To monitor your GPU, you need to setup port-forwarding on the host your
experiments are running on. This can be done in the following way:

Once you have launched your job on the mila cluster, open the log for your current experiment:

Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@
'sphinx-rtd-theme==1.0.0',
'sphinxcontrib-napoleon==0.7',
'sphinxcontrib-katex==0.8.6',
'tensorboard==2.9.1',
'tqdm==4.64.0',
'torch==1.12.0',
'torchvision==0.13.0'
'torchvision==0.13.0',
],
entry_points={
'console_scripts': [
Expand Down

0 comments on commit df88605

Please sign in to comment.