File tree Expand file tree Collapse file tree 1 file changed +22
-11
lines changed Expand file tree Collapse file tree 1 file changed +22
-11
lines changed Original file line number Diff line number Diff line change @@ -88,17 +88,28 @@ def run_subset_stage(
8888 layer_module = module ,
8989 )
9090
91- if len (subset ) == 0 :
92- if logger .isEnabledFor (logging .DEBUG ):
93- logger .debug (
94- "StageSubset: layer=%s subset=%s/%s processor=%s produced empty subset (names=%s)" ,
95- layer_index ,
96- subset_index + 1 ,
97- subset_total ,
98- processor_name ,
99- subset_names ,
100- )
101- return SubsetStageResult (processed_subset = {}, layer_inputs = layer_inputs , forward_context = None )
91+ # TODO FIXME: If a full layer has no module to quantize a simple forward() is enough and output is captured
92+ # to be used as next layer's input. So one pass forward (entire layer simple forward wihout need of dealing
93+ # with subset loops and micro forward loops, just full layer, usally XXXDecodeLayer.forward().
94+ # So output = current_layer.forward() is enough or sometimes just calling the layer callable like layer()
95+ # which same as layer.forward().
96+ #
97+ # Assume layer 2 has no modules to quantize. At beginniing loop for layer 2, we have layer_output
98+ # from completed forward_replay() of layer 1. Then pass this to layer 2 (as a whole) as layer_input
99+ # and store ouput, then immediately loop to layer 3 without any further subset work that is only necessary
100+ # if we need to quantize part of a layer.
101+ #
102+ # if len(subset) == 0:
103+ # if logger.isEnabledFor(logging.DEBUG):
104+ # logger.debug(
105+ # "StageSubset: layer=%s subset=%s/%s processor=%s produced empty subset (names=%s)",
106+ # layer_index,
107+ # subset_index + 1,
108+ # subset_total,
109+ # processor_name,
110+ # subset_names,
111+ # )
112+ # return SubsetStageResult(processed_subset={}, layer_inputs=layer_inputs, forward_context=None)
102113
103114 if is_awq_processor :
104115 logger .info (
You can’t perform that action at this time.
0 commit comments