dmx.compressor.fx.transformer.utils

Functions

gap_analysis(source, target)

Print commonality and differences between new and existing op sets

get_name_for_func_nodes(candidate, ...)

Get the unique name for functional nodes

get_op_set_from(gm)

Returns a set of ops from a GraphModule

process_args(args)

A function that goes through each arg in args and removes the proxy wrapper.

process_kwargs(kwargs)

A function that goes through each kwarg in kwargs and removes the proxy wrapper.

dmx.compressor.fx.transformer.utils.gap_analysis(source, target)

Print commonality and differences between new and existing op sets

dmx.compressor.fx.transformer.utils.get_name_for_func_nodes(candidate: str, used_names: Set[str], base_count: Dict[str, int])

Get the unique name for functional nodes

Parameters:
  • candidate (str) – used as the basis for the unique name, relevant to the user.

  • used_names (Set[str]) – A Set of names already used for nodes

  • base_count (Dict[str, int]) – A dict counting number of names sharing the same candidate base

dmx.compressor.fx.transformer.utils.get_op_set_from(gm: GraphModule | None)

Returns a set of ops from a GraphModule

dmx.compressor.fx.transformer.utils.process_args(args)

A function that goes through each arg in args and removes the proxy wrapper.

Parameters:

args (Tuple) – args for which proxy wrappers should be removed

Returns:

A tuple of args where each element has the proxy wrapper removed

dmx.compressor.fx.transformer.utils.process_kwargs(kwargs)

A function that goes through each kwarg in kwargs and removes the proxy wrapper.

Parameters:

kwargs (Dict) – kwargs for which proxy wrappers should be removed

Returns:

A dictionary of kwargs where each element has the proxy wrapper removed