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

config and model missing in Trainer #3749

Closed
jetaudio opened this issue Oct 21, 2023 · 2 comments
Closed

config and model missing in Trainer #3749

jetaudio opened this issue Oct 21, 2023 · 2 comments

Comments

@jetaudio
Copy link
Contributor

jetaudio commented Oct 21, 2023

When using deepspeed backend, Error occur: Trainer init missing 2 positional config and model. Fixing in line 321 of ludwig/backend/base.py: add missing variable.
This is the code I used:

qlora_fine_tuning_config = yaml.safe_load(
"""
model_type: llm
base_model: alexsherstinsky/Mistral-7B-v0.1-sharded
input_features:

  • name: instruction
    type: text
    output_features:
  • name: output
    type: text
    prompt:
    template: >-
    Below is an instruction that describes a task, paired with an input
    that provides further context. Write a response that appropriately
    completes the request.
    Instruction: {instruction}
    Input: {input}
    Response:
    generation:
    temperature: 0.1
    max_new_tokens: 512
    adapter:
    type: qlora
    quantization:
    bits: 4
    preprocessing:
    global_max_sequence_length: 512
    split:
    type: random
    probabilities:
    • 0.9
    • 0.05
    • 0.05
      trainer:
      type: finetune
      epochs: 1
      batch_size: 1
      eval_batch_size: 2
      gradient_accumulation_steps: 16
      learning_rate: 0.0004
      learning_rate_scheduler:
      warmup_fraction: 0.03
      backend:
      type: deepspeed
      zero_optimization:
      stage: 3
      offload_optimizer:
      device: nvme
      nvme_path: ./offload
      pin_memory: true
      fast
      """
      )
      model = LudwigModel(config=qlora_fine_tuning_config, logging_level=logging.INFO,backend='deepspeed')
      results, _ , _ = model.train(dataset=df)`
@justinxzhao
Copy link
Contributor

Hi @jetaudio,

Thanks for proposing a fix with #3750.

The PR looks fine to me, but it would be good to get a quick look from @tgaddair and @arnavgarg1 who worked on the original deepspeed integration.

@tgaddair
Copy link
Collaborator

Thanks for the PR, @jetaudio! Closing this issue as #3750 has been landed :)

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

No branches or pull requests

3 participants