[go: nahoru, domu]

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

Anyone using triton python backend? #633

Closed
3 of 4 tasks
YooSungHyun opened this issue Jun 26, 2023 · 12 comments
Closed
3 of 4 tasks

Anyone using triton python backend? #633

YooSungHyun opened this issue Jun 26, 2023 · 12 comments

Comments

@YooSungHyun
Copy link

System Info

python 3.10
tritonserver:23.05
torch 2.0.1
peft 0.3.0
transformers 4.29.2

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder
  • My own task or dataset (give details below)

Reproduction

check, triton-inference-server/server#5989
i want to use PeftModel in tritonserver:23.05, that is not ocurring error, but don't working on....

Anyone else using it like me?
please, give me some tips 😭

Expected behavior

set_adapter is work good

@YooSungHyun YooSungHyun changed the title Any one using triton python backend? Anyone using triton python backend? Jun 26, 2023
@pacman100
Copy link
Contributor

Hello @YooSungHyun, as per triton-inference-server/server#5989 (comment), the issue seems to stem from the fact that torch.compile is incompatible with Peft models at present. We will put the deep dive for this in our backlog but this will take time.

@YooSungHyun
Copy link
Author

@pacman100 thx, if you need something, i will help you. plz just tagging me🤗

@YooSungHyun
Copy link
Author

if i use like this.

model = AutoModelForCausalLM.from_pretrained(
    optional_config["model_path"],
    low_cpu_mem_usage=bool(strtobool(optional_config["low_cpu_mem_usage"])),
    load_in_8bit=bool(strtobool(optional_config["load_in_8bit"])),
    torch_dtype=getattr(torch, optional_config["torch_dtype"], None),
    device_map=device_map,
)

self.model = PeftModel.from_pretrained(
    model,
    optional_config["aa_lora_weights"],
    adapter_name=optional_config["aa_lora_name"],
    device_map=device_map,
)
self.model.load_adapter(
    optional_config["bb_lora_weights"],
    adapter_name=optional_config["bb_lora_name"],
    device_map=device_map,
)
model = torch.compile(model)
self.model.eval()

it work fine

@pacman100
Copy link
Contributor

Great! So, it works!

@YooSungHyun
Copy link
Author

@pacman100 but, this is weired... why important torch.compile's implement line number...?

@pacman100
Copy link
Contributor

Torch.compile should always be at the end of all the preprocessing of the model. For example, when using DDP too, torch.compile is applied after wrapping the model in DDP.

@YooSungHyun
Copy link
Author

@pacman100 oh thx

@YooSungHyun
Copy link
Author

@pacman100 ah.. how about eval()?

model.eval()
model = torch.compile(model)
model = torch.compile(model)
model.eval()

each correct?

@YooSungHyun YooSungHyun reopened this Jun 28, 2023
@YooSungHyun
Copy link
Author

@pacman100 hello?

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

@YooSungHyun
Copy link
Author

@pacman100

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

@github-actions github-actions bot closed this as completed Sep 4, 2023
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

2 participants