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

CI/setup #9

Merged
merged 32 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
11ae158
Create pylint.yml
lllAlexanderlll Jan 15, 2024
eadb1f8
ci: trigger CI
lllAlexanderlll Jan 15, 2024
5ddcb7c
ci: introduce our linting to github actions
lllAlexanderlll Jan 15, 2024
c1f07e6
test: aligning import statements after moves
lhahn-iis Jan 8, 2024
2244507
ci: Add tests github action
lllAlexanderlll Jan 15, 2024
05c4042
ci: Add sphinx build github action
lllAlexanderlll Jan 15, 2024
1c510e2
docs: Add empty docs folder
lllAlexanderlll Jan 15, 2024
3cf1ed3
debug: debug ci workflow
lllAlexanderlll Jan 15, 2024
b7169c4
docs: Add wiki
lllAlexanderlll Jan 15, 2024
bbb8830
docs: removed llm_gym mentionings
lllAlexanderlll Jan 15, 2024
0bc38f5
debug: ci sphinx build run
lllAlexanderlll Jan 15, 2024
0b699f2
fix: deactivate WandB per default
lhahn-iis Jan 15, 2024
16b4522
fix: support proper iterating over MemMapDatasets
lhahn-iis Jan 15, 2024
2bcf6e2
docs: refine docs
lllAlexanderlll Jan 15, 2024
5e1d971
ci: build and deploy docs
lllAlexanderlll Jan 15, 2024
b211c15
ci: build and deploy docs2
lllAlexanderlll Jan 15, 2024
0bb8614
ci: build and deploy docs3
lllAlexanderlll Jan 15, 2024
5959071
debug: trigger ci
lllAlexanderlll Jan 15, 2024
c33a8e9
debug: build gh-pages
lllAlexanderlll Jan 15, 2024
7724c15
ci: Use master branch and nit ci/setup for triggering workflows
lllAlexanderlll Jan 15, 2024
ad9de1d
debug: resolve merge conflicts
lllAlexanderlll Jan 15, 2024
1f382e0
Add files via upload
lllAlexanderlll Jan 16, 2024
21bdb82
docs: Add logo
lllAlexanderlll Jan 16, 2024
97eb0c0
ci: add workflow_dispatch for manual trigger
lllAlexanderlll Jan 16, 2024
64f6668
docs: refine docs and crop logo
lllAlexanderlll Jan 16, 2024
1652ff6
ci: triger gh-pages
lllAlexanderlll Jan 16, 2024
201aff3
refactor: rename loop var more meaningfully
lhahn-iis Jan 18, 2024
41cecab
test: use cpu-supported setup with lorem_ipsum
lhahn-iis Jan 18, 2024
13c18ad
debug: trigger tests in MR to verify them
lhahn-iis Jan 18, 2024
0bf7a61
revert: "debug: trigger tests in MR to verify them"
lhahn-iis Jan 18, 2024
a5e3551
fix: typo
lllAlexanderlll Jan 22, 2024
637364d
Remove ci/setup listener in .github/workflows/build_and_deploy_docume…
lllAlexanderlll Jan 22, 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
35 changes: 35 additions & 0 deletions .github/workflows/build_and_deploy_documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "Build Sphinx Documentation"

on:
workflow_dispatch:
push:
branches:
- main

permissions:
contents: write
lhahn-iis marked this conversation as resolved.
Show resolved Hide resolved

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
pip install myst-parser
pip install .
pip install sphinx-rtd-theme sphinx-autodoc-typehints sphinx-click sphinx-automodapi texext
- name: "Parse into HTML"
run: |
sphinx-apidoc -o docs/source/api src/modalities
sphinx-build -M html docs/source/ docs/build/
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: gh-pages
lhahn-iis marked this conversation as resolved.
Show resolved Hide resolved
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html
force_orphan: true



30 changes: 30 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Linting

on:
push:
branches:
- main
workflow_dispatch:
pull_request:
types: [review_requested, ready_for_review, auto_merge_enabled]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pre-commit
pre-commit install
- name: Analysing the code with pre-commit
run: |
pre-commit run --all-files
30 changes: 30 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Tests

on:
push:
branches:
- main
workflow_dispatch:
pull_request:
types: [review_requested, ready_for_review, auto_merge_enabled]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[tests]
- name: Run tests
run: |
pytest

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,5 @@ tags

checkpoints
data
docs/source/generated
docs/source/api
13 changes: 13 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: "2"

build:
os: "ubuntu-22.04"
tools:
python: "3.10"

python:
install:
- requirements: docs/requirements.txt

sphinx:
configuration: docs/source/conf.py
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Modalities


# Getting started
For training and evaluation a model, feel free to checkout [this](https://github.com/Modalities/modalities/blob/main/examples/getting_started/getting_started_example.md) getting started tutorial, in which we train a small, 60M-parameter GPT model on a tiny subset of the Redpajama V2 dataset.
Also, see our WIki and API reference documentation: https://modalities.github.io/modalities/

# Installation

Expand All @@ -20,6 +22,7 @@ pip install -e .
If you want to contribute, have look at `CONTRIBUTING.md`.



# Usage
For running the training endpoint on multiple GPUs run `CUDA_VISIBLE_DEVICES=2,3 torchrun --nnodes 1 --nproc_per_node 2 --rdzv-endpoint=0.0.0.0:29502 src/modalities/__main__.py run --config_file_path config_files/config.yaml`.

Expand Down
4 changes: 2 additions & 2 deletions config_files/config_lorem_ipsum.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ modalities_setup:

wandb:
project_name: modalities
mode: ONLINE
mode: OFFLINE
le1nux marked this conversation as resolved.
Show resolved Hide resolved

data:
sample_key: "input_ids"
Expand Down Expand Up @@ -121,7 +121,7 @@ running_env:
config:
process_group_backend: ${training.process_group_backend}
local_rank: ${oc.env:LOCAL_RANK}
mixed_precision_settings: BF_16
mixed_precision_settings: FP_16
sharding_strategy: FULL_SHARD
auto_wrap_policy: TRANSFORMER_AUTO_WRAP_POLICY

Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sphinx==7.1.2
sphinx-rtd-theme==1.3.0rc1
3 changes: 3 additions & 0 deletions docs/source/benchmarking.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Benchmarking
=============================
**EDIT "docs/source/benchmarking.rst" IN ORDER TO MAKE CHANGES HERE**
Loading