Skip to content
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

freeze LM #9996

Closed
wants to merge 27 commits into from
Closed

freeze LM #9996

wants to merge 27 commits into from

Conversation

puririshi98
Copy link
Contributor

@puririshi98 puririshi98 commented Jan 31, 2025

image goal^

trying the frozen pathway
when i try the PR it causes:

  File "/opt/pyg/pytorch_geometric/examples/llm/tech_qa.py", line 325, in <module>
    model, test_loader = train(args, data_lists)
                         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/pyg/pytorch_geometric/examples/llm/tech_qa.py", line 270, in train
    loss.backward()
  File "/usr/local/lib/python3.12/dist-packages/torch/_tensor.py", line 626, in backward
    torch.autograd.backward(
  File "/usr/local/lib/python3.12/dist-packages/torch/autograd/__init__.py", line 347, in backward
    _engine_run_backward(
  File "/usr/local/lib/python3.12/dist-packages/torch/autograd/graph.py", line 823, in _engine_run_backward
    return Variable._execution_engine.run_backward(  # Calls into the C++ engine to run the backward pass
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn

I want the gradients to flow through the LLM but i dont want its params updated (and any memory savings possible). what is the easiest/recommended way to do this.
initiating the model w/:
llm = LLM(model_name=args.llm_generator_name, freeze=True).eval()

@puririshi98 puririshi98 requested review from mananshah99 and a team as code owners January 31, 2025 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant