Skip to content

Commit 18eff29

Browse files
Updating API docs (#1787)
1. Updated `mkdocs.yml` with the following changes: * Added `pymdownx.magiclink` extension - automatic URL linking * Excluded utility modules (`llmcompressor.version`, `llmcompressor.typing`) from auto-generated docs * Updated mkdocstrings config with new options: - `docstring_section_style`: list - Added list section formatting - `filters`: ["!^_"] - Hide private/internal methods from docs - `merge_init_into_class`: true - Merge class documentation - `separate_signature`: true - Function signature display - `show_root_heading`: true - Clear module headers - `show_signature_annotations`: true - Type hint visibility - `show_symbol_type_heading`: true - Clear type indicators - `summary`: true - Include summary sections https://mkdocstrings.github.io/python/reference/api/ 2. Added high level doc strings to most modules. **Note**: Used Claude to summarize and create new docstrings. Preview: https://vllm--1787.org.readthedocs.build/projects/llm-compressor/en/1787/ --------- Signed-off-by: Aidan Reilly <[email protected]> Co-authored-by: Brian Dellabetta <[email protected]>
1 parent a2dd4a1 commit 18eff29

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+397
-28
lines changed

mkdocs.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ markdown_extensions:
7070
- pymdownx.mark
7171
- pymdownx.smartsymbols
7272
- pymdownx.snippets
73+
- pymdownx.magiclink
7374
- pymdownx.superfences:
7475
custom_fences:
7576
- name: mermaid
@@ -85,6 +86,9 @@ markdown_extensions:
8586
plugins:
8687
- api-autonav:
8788
modules: ['src/llmcompressor']
89+
exclude:
90+
- "llmcompressor.version"
91+
- "llmcompressor.typing"
8892
- gen-files:
8993
scripts:
9094
- docs/scripts/gen_files.py
@@ -96,7 +100,21 @@ plugins:
96100
handlers:
97101
python:
98102
options:
99-
docstring_style: sphinx
103+
docstring_section_style: list
104+
show_if_no_docstring: false
105+
docstring_style: "sphinx"
106+
filters:
107+
- "!docstring"
108+
- "!^_"
109+
heading_level: 1
110+
merge_init_into_class: true
111+
parameter_headings: true
112+
separate_signature: true
113+
show_root_heading: true
114+
show_signature_annotations: true
115+
show_symbol_type_heading: true
116+
show_symbol_type_toc: true
117+
summary: true
100118
- search
101119
- section-index
102120
- social

src/llmcompressor/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
2-
A library for compressing large language models utilizing the latest techniques and
3-
research in the field for both training aware and post training techniques.
2+
LLM Compressor is a library for compressing large language models utilizing
3+
the latest techniques and research in the field for both training aware and
4+
post-training techniques.
45
56
The library is designed to be flexible and easy to use on top of
67
PyTorch and HuggingFace Transformers, allowing for quick experimentation.

src/llmcompressor/args/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# ruff: noqa
22

3+
"""
4+
Arguments package for LLM Compressor.
5+
6+
Defines structured argument classes for datasets, models, training, and
7+
recipes, along with utilities for parsing them.
8+
"""
9+
310
from .dataset_arguments import DatasetArguments
411
from .model_arguments import ModelArguments
512
from .recipe_arguments import RecipeArguments

src/llmcompressor/args/dataset_arguments.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
"""
2+
Dataset argument classes for LLM compression workflows.
3+
4+
This module defines dataclass-based argument containers for configuring dataset
5+
loading, preprocessing, and calibration parameters across different dataset
6+
sources and processing pipelines. Supports various input formats including
7+
HuggingFace datasets, custom JSON/CSV files, and DVC-managed datasets.
8+
"""
9+
110
from dataclasses import dataclass, field
211
from typing import Any, Callable, Dict, List, Optional, Union
312

src/llmcompressor/args/model_arguments.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
"""
2+
Model argument classes for LLM compression workflows.
3+
4+
This module defines dataclass-based argument containers for configuring model
5+
loading, tokenization, and preprocessing parameters. Supports various model
6+
sources including HuggingFace model hub, local paths, and custom
7+
configurations for compression workflows.
8+
"""
9+
110
from dataclasses import dataclass, field
211
from typing import Optional
312

src/llmcompressor/args/recipe_arguments.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
"""
2+
Recipe argument classes for LLM compression workflows.
3+
4+
Defines dataclass-based argument containers for configuring sparsification
5+
recipes, compression sessions, and stage-based execution parameters used in
6+
model compression and optimization workflows.
7+
"""
8+
19
from dataclasses import dataclass, field
210
from typing import List, Optional
311

src/llmcompressor/args/training_arguments.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
"""
2+
Training argument classes for LLM compression workflows.
3+
4+
This module defines dataclass-based argument containers for configuring
5+
training and one-shot calibration workflows. Extends HuggingFace's
6+
TrainingArguments with additional parameters specific to compression and
7+
stage-based execution.
8+
"""
9+
110
from dataclasses import dataclass, field
211
from typing import Optional
312

src/llmcompressor/args/utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
"""
2+
Utility functions for parsing and processing argument classes.
3+
4+
Provides helper functions for parsing command-line arguments and
5+
configuration dictionaries into structured argument dataclasses used in
6+
LLM compression workflows. Handles argument validation, deprecation
7+
warnings, and processor resolution.
8+
"""
9+
110
from typing import Tuple
211

312
from loguru import logger

src/llmcompressor/core/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
"""
2+
Provides the core compression framework for LLM Compressor.
3+
4+
The core API manages compression sessions, tracks state changes, handles events
5+
during compression, and Provides lifecycle hooks for the compression
6+
process.
7+
"""
8+
19
from llmcompressor.core.events import Event, EventType
210
from llmcompressor.core.lifecycle import CompressionLifecycle
311
from llmcompressor.core.model_layer import ModelParameterizedLayer

src/llmcompressor/core/helpers.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
"""
2+
Helper functions for core compression operations.
3+
4+
Provides utility functions for logging model information and state
5+
management during compression workflows. Includes functionality for
6+
conditional logging and parameter tracking.
7+
"""
8+
19
from typing import Any, Generator, Optional, Tuple, Union
210

311
from llmcompressor.core.state import State

0 commit comments

Comments
 (0)