mirror of https://github.com/hpcaitech/ColossalAI
[fp8] fix linear hook (#6046)
parent
c3b5caff0e
commit
26e553937b
|
@ -119,7 +119,8 @@ class HybridParallelModule(ModelWrapper, AMPModelMixin):
|
||||||
if use_fp8:
|
if use_fp8:
|
||||||
self.op_hooks.append(FP8Hook())
|
self.op_hooks.append(FP8Hook())
|
||||||
if overlap_allgather:
|
if overlap_allgather:
|
||||||
self.op_hook = ZeroOpHook()
|
self.op_hooks.append(ZeroOpHook())
|
||||||
|
if use_fp8 or overlap_allgather:
|
||||||
for p in module.parameters():
|
for p in module.parameters():
|
||||||
if p.requires_grad and type(p) is not ColoParameter:
|
if p.requires_grad and type(p) is not ColoParameter:
|
||||||
p.__class__ = ColoParameter
|
p.__class__ = ColoParameter
|
||||||
|
|
Loading…
Reference in New Issue