Skip to content

Commit

Permalink
Move nf4 op registration from utils to modules (#1035)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebsmothers authored May 31, 2024
1 parent 3b1bcf9 commit 0c4056a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions torchtune/modules/low_precision/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
2 changes: 1 addition & 1 deletion torchtune/modules/peft/lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from torch import nn, Tensor

from torchao.dtypes.nf4tensor import linear_nf4, to_nf4
from torchtune.modules.low_precision import _register_nf4_dispatch_ops # noqa: F401
from torchtune.modules.peft.peft_utils import AdapterModule
from torchtune.utils import _register_nf4_dispatch_ops # noqa: F401


class LoRALinear(nn.Module, AdapterModule):
Expand Down

0 comments on commit 0c4056a

Please sign in to comment.