llmcompressor.transformers.tracing.debug
trace(model_id, model_class, sequential_targets=None, ignore=[], modality='text', trust_remote_code=True)
Debug traceability by tracing a pre-trained model into subgraphs
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_id | str | stub of the model to load | required |
model_class | Type[PreTrainedModel] | class constructor of the pre-trained model. Can use either HF transformers classes or | required |
sequential_targets | Optional[Union[List[str], str]] | targets for sequential tracing, defaults to automatic inference | None |
ignore | Union[List[str], str] | patterns to ignore during tracing | [] |
modality | str | data modality for dummy tracing data, defaults to 'text' | 'text' |
trust_remote_code | bool | trust remote model code Example usage from CLI llmcompressor.trace --model_id Qwen/Qwen2-VL-2B-Instruct --model_class Qwen2VLForConditionalGeneration --sequential_targets Qwen2VLDecoderLayer --ignore "lm_head" "re:visual.*" --modality text | True |