bitorch_engine.utils.convert

Functions

collect_layers

Collect the names of all layers within a module recursively with certain types.

get_mpq_config

This function returns the parameters for a given strategy string.

quantize_linear_with_binary_linear_cuda

Replace all layers contained in names_to_replace within the given module with BinaryLinearCuda layers.

quantize_linear_with_mpq_linear_cuda

Replace all layers contained in names_to_replace within the given module with MPQLinearCuda layers.

quantize_linear_with_q4_linear_cutlass

Replace all layers contained in names_to_replace within the given module with Q4LinearCutlass layers.

replace_layers

This function replaces all layers (recursively) within the given modules, whose names are included in the given list.