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

Add API docs for ONNX Runtime and Intel #100

Merged
merged 27 commits into from
Mar 23, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion .github/workflows/build_dev_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ jobs:
cd ..

cd optimum
pip install .[dev]
apt install -y libopencv-dev python3-opencv
pip install .[dev,onnxruntime,intel]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to include all the dependencies here to build the docs

cd ..

- name: Setup git
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ jobs:
run: |
pip install git+https://github.com/huggingface/doc-builder
cd optimum
pip install .[dev]
apt install -y libopencv-dev python3-opencv
pip install .[dev,onnxruntime,intel]
cd ..

- name: Setup git
Expand Down
25 changes: 24 additions & 1 deletion docs/source/_toctree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,27 @@
- local: index
title: 🤗 Optimum
- local: quickstart
title: Quickstart
title: Quickstart
title: Get started
- sections:
- local: onnxruntime/configuration
title: Configuration
- local: onnxruntime/optimization
title: Optimization
- local: onnxruntime/quantization
title: Quantization
- local: onnxruntime/trainer
title: Trainer
title: ONNX Runtime
- sections:
- local: intel/configuration
title: Configuration
- local: intel/optimization
title: Optimization
- local: intel/quantization
title: Quantization
- local: intel/pruning
title: Pruning
- local: intel/trainer
title: Trainer
title: Intel Neural Compressor
17 changes: 17 additions & 0 deletions docs/source/intel/configuration.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--Copyright 2022 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# Configuration

## IncConfig

[[autodoc]] intel.neural_compressor.config.IncConfig
17 changes: 17 additions & 0 deletions docs/source/intel/optimization.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--Copyright 2022 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# Optimization

## IncOptimizer

[[autodoc]] intel.neural_compressor.optimizer.IncOptimizer
Copy link
Member Author

@lewtun lewtun Mar 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with the onnxruntime package, I suggest we rename this module to intel.neural_compressor.optimization. I realise this is a breaking change, but I think it will help optimum users more easily navigate the API.

We can discuss this in a separate issue / thread since it doesn't relate to this PR very strongly

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's a good point, I was also thinking to rename intel.neural_compressor.config to intel.neural_compressor.configuration for the same reason. I agree that this is an important change that should be done as soon as possible (before our next release, which should be soon)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK great, let's tackle that in a separate PR :)

17 changes: 17 additions & 0 deletions docs/source/intel/pruning.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--Copyright 2022 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# Pruning

## IncPruningMode

[[autodoc]] intel.neural_compressor.pruning.IncPruningMode
21 changes: 21 additions & 0 deletions docs/source/intel/quantization.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--Copyright 2022 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# Quantization

## IncQuantizer

[[autodoc]] intel.neural_compressor.quantization.IncQuantizer

## IncQuantizedModel

[[autodoc]] intel.neural_compressor.quantization.IncQuantizedModel
17 changes: 17 additions & 0 deletions docs/source/intel/trainer.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--Copyright 2022 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# Trainer

## IncTrainer

[[autodoc]] intel.neural_compressor.trainer_inc.IncTrainer
17 changes: 17 additions & 0 deletions docs/source/onnxruntime/configuration.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--Copyright 2022 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# Configuration

## ORTConfig

[[autodoc]] onnxruntime.configuration.ORTConfig
17 changes: 17 additions & 0 deletions docs/source/onnxruntime/optimization.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--Copyright 2022 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# Optimization

## ORTOptimizer

[[autodoc]] onnxruntime.optimization.ORTOptimizer
21 changes: 21 additions & 0 deletions docs/source/onnxruntime/quantization.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--Copyright 2022 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# Quantization

## ORTCalibrationDataReader

[[autodoc]] onnxruntime.quantization.ORTCalibrationDataReader

## ORTQuantizer

[[autodoc]] onnxruntime.quantization.ORTQuantizer
17 changes: 17 additions & 0 deletions docs/source/onnxruntime/trainer.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--Copyright 2022 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# Trainer

## ORTTrainer

[[autodoc]] onnxruntime.trainer.ORTTrainer
6 changes: 6 additions & 0 deletions optimum/intel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from .neural_compressor.config import IncConfig, IncPruningConfig, IncQuantizationConfig
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I have to include the neural_compressor imports in the root init of the intel subpackage to build the docs

from .neural_compressor.optimizer import IncOptimizer
from .neural_compressor.pruning import IncPruner, IncPruningMode
from .neural_compressor.quantization import IncQuantizationMode, IncQuantizer
from .neural_compressor.trainer_inc import IncTrainer