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

Cleanup MegaBlocks Installation #126

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from 18 commits
Commits
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
176 changes: 168 additions & 8 deletions .gitignore
eitanturok marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,8 +1,168 @@
*~
gpt2-merges.txt
gpt2-vocab.json
core
__pycache__
*.egg-info
dist
build
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/
docs/path/
docs/source/_build/
docs/source/api_reference/
# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# Virtual Env
venv/

# WandB
wandb/

# Neptune
.neptune/

# Spacemacs
._#*
.#*
.vscode/

# Vim
*.swp

# README backups
README.md.bkp

# OS X
.DS_Store

# Sphinx
api_reference/

# Node (for pyright)
node_modules/
package.json
package-lock.json

# pycharm
.idea/

# composer
data/
eitanturok marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ NOTE: This assumes you have `numpy` and `torch` installed.

Installing `megablocks[gg]` enables dMoE computation with grouped GEMM. This feature is enabled by setting the `mlp_impl` argument to `grouped`. This is currently our recommended path for Hopper-generation GPUs.

To contribute to MegaBlock, install `megablocks[dev]`. Run `pre-commit install` to configure the [pre-commit](https://pre-commit.com/) hook and then run `pre-commit run` before each commit to automatically format the code.
eitanturok marked this conversation as resolved.
Show resolved Hide resolved

MegaBlocks can be installed with all dependencies via the `megablocks[all]` package.

# :steam_locomotive: Usage
Expand Down
14 changes: 12 additions & 2 deletions megablocks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
import megablocks.layers.dmoe
import megablocks.layers.moe
# Copyright 2024 MosaicML MegaBlocks authors
eitanturok marked this conversation as resolved.
Show resolved Hide resolved
# SPDX-License-Identifier: Apache-2.0

from megablocks._version import __version__
from megablocks.layers import dmoe, moe

"""Some key classes are available directly in the ``MegaBlocks`` namespace."""
eitanturok marked this conversation as resolved.
Show resolved Hide resolved

__all__ = [
'dmoe',
'moe',
]
6 changes: 6 additions & 0 deletions megablocks/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright 2022 MegaBlocks Composer authors
# SPDX-License-Identifier: Apache-2.0

"""The MegaBlocks Version."""

__version__ = '0.5.1'
Loading