Skip to content

Implement the LoRA forward and backward passes with NKI #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nandeeka
Copy link
Contributor

@nandeeka nandeeka commented Jan 21, 2025

Description of changes:

Implements the LoRA forward and backward passes with NKI. Contribution requested by @EmilyWebber.

Testing:

Please see detailed unit test requirements in the CONTRIBUTING.md

  • The change is covered by numeric check using nki.baremetal
  • The change is covered by performance benchmark test using nki.benchmark

Pull Request Checklist

  • I have filled in all the required field in the template
  • I have tested locally that all the tests pass
  • By submitting this pull request, I confirm that my contribution is made under the terms of the MIT-0 license.

import neuronxcc.nki.isa as ni
import numpy as np

def lora_bwd(I_DRAM, PW_DRAM, A_DRAM, B_DRAM, AI_DRAM, dO_DRAM, alpha):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get documentation on expected shape and important highlights of the algorithm approach etc...?

import neuronxcc.nki.isa as ni
import numpy as np

def lora_fwd(I_DRAM, PW_DRAM, A_DRAM, B_DRAM, dropout, alpha):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation of the algorithm for the optimization, parameter shapes etc...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants