[Bugfix][ROCm] Create linear layer biases with requires_grad=False (#56161)
Signed-off-by: Micah Williamson <micah.williamson@amd.com>
This commit is contained in:
@@ -4022,7 +4022,7 @@ steps:
|
|||||||
#------------------------------------------------------ mi355 · weight_loading -------------------------------------------------------#
|
#------------------------------------------------------ mi355 · weight_loading -------------------------------------------------------#
|
||||||
|
|
||||||
- label: ":amd: (MI355) Weight Loading Multi-GPU" # TBD
|
- label: ":amd: (MI355) Weight Loading Multi-GPU" # TBD
|
||||||
timeout_in_minutes: 30
|
timeout_in_minutes: 40
|
||||||
mirror_hardwares: [amdexperimental, amdproduction, amdgfx950nightly, amdmi355]
|
mirror_hardwares: [amdexperimental, amdproduction, amdgfx950nightly, amdmi355]
|
||||||
dind: false
|
dind: false
|
||||||
agent_pool: mi355_2
|
agent_pool: mi355_2
|
||||||
|
|||||||
@@ -380,7 +380,8 @@ class ReplicatedLinear(LinearBase):
|
|||||||
|
|
||||||
if bias:
|
if bias:
|
||||||
self.bias = Parameter(
|
self.bias = Parameter(
|
||||||
torch.empty(self.output_size, dtype=self.params_dtype)
|
torch.empty(self.output_size, dtype=self.params_dtype),
|
||||||
|
requires_grad=False,
|
||||||
)
|
)
|
||||||
set_weight_attrs(
|
set_weight_attrs(
|
||||||
self.bias,
|
self.bias,
|
||||||
@@ -525,7 +526,8 @@ class ColumnParallelLinear(LinearBase):
|
|||||||
|
|
||||||
if bias:
|
if bias:
|
||||||
self.bias = Parameter(
|
self.bias = Parameter(
|
||||||
torch.empty(self.output_size_per_partition, dtype=params_dtype)
|
torch.empty(self.output_size_per_partition, dtype=params_dtype),
|
||||||
|
requires_grad=False,
|
||||||
)
|
)
|
||||||
set_weight_attrs(
|
set_weight_attrs(
|
||||||
self.bias,
|
self.bias,
|
||||||
@@ -1708,7 +1710,10 @@ class RowParallelLinear(LinearBase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if bias:
|
if bias:
|
||||||
self.bias = Parameter(torch.empty(self.output_size, dtype=params_dtype))
|
self.bias = Parameter(
|
||||||
|
torch.empty(self.output_size, dtype=params_dtype),
|
||||||
|
requires_grad=False,
|
||||||
|
)
|
||||||
set_weight_attrs(
|
set_weight_attrs(
|
||||||
self.bias,
|
self.bias,
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user