ShapeProfileManager

class qlip.compiler.manager.ShapeProfileManager(modules, type='static', opt='mode', fake_mode=False)

Bases: object

Shape profile manager controls shape collection.

Parameters

  • modules (List[CompiledModule]) – Modules to apply shape profile manager on.

  • type (str) – Type of shape profile (“static” or “dynamic”).

  • opt (str) – The method to choose optimal shape for dynamic axes profile. Can be “mode”, “min” or “max”.

  • fake_mode (bool) – Whether to enable FakeTensorMode for shape inference without actual computation. Default is False.

skip_n(n=1)

Skip n forward passes during shape profile construction.

Parameters

  • n (int) – Number of forward passes to skip.