You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ Help on open source projects is always welcome and there is always something tha
22
22
23
23
For any contributions that need design changes/API changes, reach out to maintainers to check if an Architectural Design Record would be beneficial. Reason for ADR: teams agree on the design, to avoid back and forth after writing code. An ADR gives context on the code being written. If requested for an ADR, make a contribution [using the template](./architecture_records/template.md).
24
24
25
-
When contributing, it's useful to start by looking at [issues](https://github.com/foundation-model-stack/fms-model-optimization/issues). After picking up an issue, writing code, or updating a document, make a pull request and your work will be reviewed and merged. If you're adding a new feature or find a bug, it's best to [write an issue](https://github.com/foundation-model-stack/fms-model-optimization/issues/new) first to discuss it with maintainers.
25
+
When contributing, it's useful to start by looking at [issues](https://github.com/foundation-model-stack/fms-model-optimizer/issues). After picking up an issue, writing code, or updating a document, make a pull request and your work will be reviewed and merged. If you're adding a new feature or find a bug, it's best to [write an issue](https://github.com/foundation-model-stack/fms-model-optimizer/issues/new) first to discuss it with maintainers.
26
26
27
27
To contribute to this repo, you'll use the Fork and Pull model common in many open source repositories. For details on this process, check out [The GitHub Workflow
@@ -35,9 +35,9 @@ Before sending pull requests, make sure your changes pass formatting, linting an
35
35
#### Dependencies
36
36
If additional new Python module dependencies are required, think about where to put them:
37
37
38
-
- If they're required for fms-model-optimization, then append them to the [dependencies](https://github.com/foundation-model-stack/fms-model-optimization/blob/main/pyproject.toml#L28) in the pyproject.toml.
39
-
- If they're optional dependencies for additional functionality, then put them in the pyproject.toml file like were done for [flash-attn](https://github.com/foundation-model-stack/fms-model-optimization/blob/main/pyproject.toml#L44) or [aim](https://github.com/foundation-model-stack/fms-model-optimization/blob/main/pyproject.toml#L45).
40
-
- If it's an additional dependency for development, then add it to the [dev](https://github.com/foundation-model-stack/fms-model-optimization/blob/main/pyproject.toml#L43) dependencies.
38
+
- If they're required for fms-model-optimizer, then append them to the [dependencies](https://github.com/foundation-model-stack/fms-model-optimizer/blob/main/pyproject.toml#L28) in the pyproject.toml.
39
+
- If they're optional dependencies for additional functionality, then put them in the pyproject.toml file like were done for [flash-attn](https://github.com/foundation-model-stack/fms-model-optimizer/blob/main/pyproject.toml#L44) or [aim](https://github.com/foundation-model-stack/fms-model-optimizer/blob/main/pyproject.toml#L45).
40
+
- If it's an additional dependency for development, then add it to the [dev](https://github.com/foundation-model-stack/fms-model-optimizer/blob/main/pyproject.toml#L43) dependencies.
41
41
42
42
#### Code Review
43
43
@@ -56,19 +56,19 @@ This section guides you through submitting a bug report. Following these guideli
56
56
57
57
#### How Do I Submit A (Good) Bug Report?
58
58
59
-
Bugs are tracked as [GitHub issues using the Bug Report template](https://github.com/foundation-model-stack/fms-model-optimization/issues/new?template=bug_report.md). Create an issue on that and provide the information suggested in the bug report issue template.
59
+
Bugs are tracked as [GitHub issues using the Bug Report template](https://github.com/foundation-model-stack/fms-model-optimizer/issues/new?template=bug_report.md). Create an issue on that and provide the information suggested in the bug report issue template.
60
60
61
61
### Suggesting Enhancements
62
62
63
63
This section guides you through submitting an enhancement suggestion, including completely new features, tools, and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion ✏️ and find related suggestions 🔎
64
64
65
65
#### How Do I Submit A (Good) Enhancement Suggestion?
66
66
67
-
Enhancement suggestions are tracked as [GitHub issues using the Feature Request template](https://github.com/foundation-model-stack/fms-model-optimization/issues/new?template=feature_request.md). Create an issue and provide the information suggested in the feature requests or user story issue template.
67
+
Enhancement suggestions are tracked as [GitHub issues using the Feature Request template](https://github.com/foundation-model-stack/fms-model-optimizer/issues/new?template=feature_request.md). Create an issue and provide the information suggested in the feature requests or user story issue template.
68
68
69
69
#### How Do I Submit A (Good) Improvement Item?
70
70
71
-
Improvements to existing functionality are tracked as [GitHub issues using the User Story template](https://github.com/foundation-model-stack/fms-model-optimization/issues/new?template=user_story.md). Create an issue and provide the information suggested in the feature requests or user story issue template.
71
+
Improvements to existing functionality are tracked as [GitHub issues using the User Story template](https://github.com/foundation-model-stack/fms-model-optimizer/issues/new?template=user_story.md). Create an issue and provide the information suggested in the feature requests or user story issue template.
72
72
73
73
## Development
74
74
@@ -94,7 +94,7 @@ make test
94
94
95
95
#### Formatting
96
96
97
-
FMS Model Optimization follows the python [pep8](https://peps.python.org/pep-0008/) coding style. The coding style is enforced by the CI system, and your PR will fail until the style has been applied correctly.
97
+
FMS Model Optimizer follows the python [pep8](https://peps.python.org/pep-0008/) coding style. The coding style is enforced by the CI system, and your PR will fail until the style has been applied correctly.
98
98
99
99
We use [pre-commit](https://pre-commit.com/) to enforce coding style using [black](https://github.com/psf/black), [prettier](https://github.com/prettier/prettier) and [isort](https://pycqa.github.io/isort/).
100
100
@@ -145,8 +145,8 @@ Running the command will create a single ZIP-format archive containing the libra
145
145
146
146
Unsure where to begin contributing? You can start by looking through these issues:
147
147
148
-
- Issues with the [`good first issue` label](https://github.com/foundation-model-stack/fms-model-optimization/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) - these should only require a few lines of code and are good targets if you're just starting contributing.
149
-
- Issues with the [`help wanted` label](https://github.com/foundation-model-stack/fms-model-optimization/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) - these rangefrom simple to more complex, but are generally things we want but can't get to in a short time frame.
148
+
- Issues with the [`good first issue` label](https://github.com/foundation-model-stack/fms-model-optimizer/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) - these should only require a few lines of code and are good targets if you're just starting contributing.
149
+
- Issues with the [`help wanted` label](https://github.com/foundation-model-stack/fms-model-optimizer/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) - these rangefrom simple to more complex, but are generally things we want but can't get to in a short time frame.
FMS Model Optimizer is a framework for developing reduced precision neural network models. Quantization techniques, such as [quantization-aware-training (QAT)](https://arxiv.org/abs/2407.11062), [post-training quantization (PTQ)](https://arxiv.org/abs/2102.05426), and several other optimization techniques on popular deep learning workloads are supported.
6
+
7
+
## Highlights
8
+
9
+
-**Python API to enable model quantization:** With addition of a few lines of codes, module-level and/or function-level operations replacement will be performed.
10
+
-**Robust:** Verified for INT 8/4/2-bit quantization on Vision/Speech/NLP/Object Detection/LLM
11
+
-**Flexible:** This package can analyze the network using PyTorch Dynamo, apply best practices, such as clip_val initialization, layer-level precision setting, optimizer param group setting, etc. Users can also easily customize any of the settings through a JSON config file, and even bypass the Dynamo tracing if preferred.
12
+
-**State-of-the-art INT and FP quantization techniques:** For weights and activations, such as SAWB+ and PACT+, comparable or better than other published works.
13
+
-**Supports key compute-intensive operations:** Conv2d, Linear, LSTM, MM, BMM
- To enable compute graph plotting function (mostly for troubleshooting purpose):
48
+
-[graphviz](https://graphviz.org/)
49
+
-[pygraphviz](https://pygraphviz.github.io/)
50
+
51
+
> [!NOTE]
52
+
> PyTorch version should be < 2.4 if you would like to experiment deployment with external INT8 kernel.
53
+
54
+
### Installation
55
+
56
+
We recommend using a Python virtual environment with Python 3.10+. Here is how to setup a virtual environment using [Python venv](https://docs.python.org/3/library/venv.html):
57
+
58
+
```
59
+
python3 -m venv fms_mo_venv
60
+
source fms_mo_venv/bin/activate
61
+
```
62
+
63
+
> [!TIP]
64
+
> If you use [pyenv](https://github.com/pyenv/pyenv), [Conda Miniforge](https://github.com/conda-forge/miniforge) or other such tools for Python version management, create the virtual environment with that tool instead of venv. Otherwise, you may have issues with installed packages not being found as they are linked to your Python version management tool and not `venv`.
To help you get up and running as quickly as possible with the FMS Model Optimizer framework, check out the following resources which demonstrate how to use the framework with different quantization techniques:
79
+
80
+
- Jupyter notebook tutorials (It is recommended to begin here):
0 commit comments