xbtorch.patches.utils
Functions
|
Recursively replace all modules within a model with XBTorch modules for stateful operation. |
|
Recursively replace all modules within a model with XBTorch modules for stateless operation. |
|
Recursively enable or disable linear modules within a model with some customized layer module. |
- xbtorch.patches.utils.replace_all_layers_stateful(model, wage_quantize)[source]
Recursively replace all modules within a model with XBTorch modules for stateful operation. Supports wage quantization.
- xbtorch.patches.utils.replace_all_layers_stateless(model: <module 'transformers.models' from '/opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/site-packages/transformers/models/__init__.py'>, exclude: list = []) None[source]
Recursively replace all modules within a model with XBTorch modules for stateless operation.