FMS Acceleration Framework Library
This contains the library code that implements the acceleration plugin framework, in particular the classes:
AccelerationFrameworkAccelerationPlugin
The library is envisioned to:
- Provide single integration point into Huggingface.
- Manage
AccelerationPluginin a flexible manner. - Load plugins from single configuration YAML, while enforcing compatiblity rules on how plugins can be combined.
See following resources:
- Instructions for running acceleration framework with
fms-hf-tuning - Sample plugin YAML configurations for important accelerations.
Using AccelerationFramework with HF Trainer
Being by instantiating an AccelerationFramework object, passing a YAML configuration (say via a path_to_config):
from fms_acceleration import AccelerationFramework
framework = AccelerationFramework(path_to_config)
Plugins automatically configured based on configuration; for more details on how plugins are configured, see below.
Some plugins may require custom model loaders (in replacement of the typical AutoModel.from_pretrained). In this case, call framework.model_loader:
model = framework.model_loader(model_name_or_path, ...)
E.g., in the GPTQ example, see sample GPTQ QLoRA configuration, we require model_name_or_path to be custom loaded from a quantized checkpoint.
We provide a flag framework.requires_custom_loading to check if plugins require custom loading.
Also some plugins will require the model to be augmented, e.g., replacing layers with plugin-compliant PEFT adapters. In this case:
# will also take in some other configs that may affect augmentation
# some of these args may be modified due to the augmentation
# e.g., peft_config will be consumed in augmentation, and returned as None
# to prevent SFTTrainer from doing extraneous PEFT logic
model, (peft_config,) = framework.augmentation(
model,
train_args, modifiable_args=(peft_config,),
)
We also provide framework.requires_augmentation to check if augumentation is required by the plugins.
Finally pass the model to train:
# e.g. using transformers.Trainer. Pass in model (with training enchancements)
trainer = Trainer(model, ...)
# call train
trainer.train()
Thats all! the model will not be reap all acceleration speedups based on the plugins that were installed!
Configuration of Plugins
Each package in this monorepo:
-
can be independently installed. Install only the libraries you need:
pip install fms-acceleration/plugins/accelerated-peft pip install fms-acceleration/plugins/fused-ops-and-kernels
-
can be independently configured. Each plugin is registed under a particular configuration path. E.g., the autogptq plugin is reqistered under the config path
peft.quantization.auto_gptq.AccelerationPlugin.register_plugin( AutoGPTQAccelerationPlugin, configuration_and_paths=["peft.quantization.auto_gptq"], )
This means that it will be configured under theat exact stanza:
plugins: peft: quantization: auto_gptq: # everything under here will be passed to plugin # when instantiating ...
-
When instantiating
fms_acceleration.AccelerationFramework, it internally parses through the configuration stanzas. For plugins that are installed, it will instantiate them; for those that are not, it will simply passthrough. -
AccelerationFrameworkwill manage plugins transparently for user. User only needs to callAccelerationFramework.model_loaderandAccelerationFramework.augmentation.
Adding New Plugins
To add new plugins:
-
Create an appropriately
pip-packaged plugin inplugins; the package needs to be named likefms-acceleration-<postfix>. -
For
frameworkto properly load and manage plugin, add the package<postfix>to constants.py:PLUGINS = [ "peft", "foak", "<postfix>", ]
-
Create a sample template YAML file inside the
<PLUGIN_DIR>/configsto demonstrate how to configure the plugin. As an example, reference the sample config for accelerated peft. -
Update generate_sample_configurations.py and run
tox -e gen-configson the top level directory to generate the sample configurations.KEY_AUTO_GPTQ = "auto_gptq" KEY_BNB_NF4 = "bnb-nf4" PLUGIN_A = "<NEW PLUGIN NAME>" CONFIGURATIONS = { KEY_AUTO_GPTQ: "plugins/accelerated-peft/configs/autogptq.yaml", KEY_BNB_NF4: ( "plugins/accelerated-peft/configs/bnb.yaml", [("peft.quantization.bitsandbytes.quant_type", "nf4")], ), PLUGIN_A: ( "plugins/<plugin>/configs/plugin_config.yaml", [ (<1st field in plugin_config.yaml>, <value>), (<2nd field in plugin_config.yaml>, <value>), ] ) } # Passing a tuple of configuration keys will combine the templates together COMBINATIONS = [ ("accelerated-peft-autogptq", (KEY_AUTO_GPTQ,)), ("accelerated-peft-bnb-nf4", (KEY_BNB_NF4,)), (<"combined name with your plugin">), (KEY_AUTO_GPTQ, PLUGIN_A) (<"combined name with your plugin">), (KEY_BNB_NF4, PLUGIN_A) ]
-
After sample configuration is generated by
tox -e gen-configs, update CONTENTS.yaml with the shortname and the configuration fullpath. -
Update scenarios YAML to configure benchmark test scenarios that will be triggered when running
tox -e run-bencheson the top level directory. -
Update the top-level tox.ini to install the plugin for the
run-benches.
Metadata
Release files for fms-acceleration 0.6.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fms_acceleration-0.6.4-py3-none-any.whl | Python 3 | none | any | Details for fms_acceleration-0.6.4-py3-none-any.whl |
Release files / fms_acceleration-0.6.4-py3-none-any.whl
| Download URL | fms_acceleration-0.6.4-py3-none-any.whl |
|---|---|
| Size | 25.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2ea9e6909b73267dade223e503fab904bb3192e4dfc0c94e1e89f82e5b0162aa
|
|
BLAKE2b-256 checksum How to use checksums |
5cb228499cd818b88d4d4269d096b6eddc5f4181f59a37548e3609c48ed16719
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 9, 2025.
Transparency logSecurity for fms-acceleration 0.6.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 1 file in this release has been uploaded with provenance metadata.
Attestation for fms_acceleration-0.6.4-py3-none-any.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 9, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.