Giter VIP home page Giter VIP logo

Comments (5)

MikeDean2367 avatar MikeDean2367 commented on June 8, 2024

您好,只需要在运行命令前加上``CUDA_VISIBLE_DEVICES=...`即可,比如您希望在卡0和卡2上进行运行,则运行下面的命令:

CUDA_VISIBLE_DEVICES=0,2 python examples/generate_finetune_web.py --base_model zjunlp/knowlm-13b-base-v1.0

如有其他问题,请告知我 :)

from knowlm.

zxlzr avatar zxlzr commented on June 8, 2024

请问您的问题是否已解决?

from knowlm.

fishfree avatar fishfree commented on June 8, 2024

谢谢您!问题仍未解决。我用了拥有的4张卡,还是类似的报错:

(knowlm) me@ubuntugpu:~/KnowLM$ CUDA_VISIBLE_DEVICES=0,1,2,3 python examples/generate_lora.py --base_model zjunlp/knowlm-13b-zhixi --run_ie_cases
testing ie ablities!
load_8bit=False
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:20<00:00,  6.88s/it]
instruction: 我将给你个输入,请根据事件类型列表:['旅游行程'],论元角色列表:['旅游地点', '旅游时间', '旅游人员'],从输入中抽取出可能包含的事件,并以(事件触发词,事件类型,[(事件论元,论元角色)])的形式回答。
input: John昨天在纽约的咖啡馆见到了他的朋友Merry。他们一起喝咖啡聊天,计划着下周去加利福尼亚(California)旅行。他们决定一起租车并预订酒店。他们先计划在下周一去圣弗朗西斯科参观旧金山大桥,下周三去洛杉矶拜访Merry的父亲威廉。
GenerationConfig {
  "num_beams": 4,
  "repetition_penalty": 1.3,
  "temperature": 0.2,
  "top_k": 40,
  "top_p": 0.75,
  "transformers_version": "4.28.1"
}

Traceback (most recent call last):
  File "/mnt/data/me/KnowLM/examples/generate_lora.py", line 217, in <module>
    fire.Fire(main)
  File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/fire/core.py", line 141, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)
  File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/fire/core.py", line 475, in _Fire
    component, remaining_args = _CallAndUpdateTrace(
  File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
  File "/mnt/data/me/KnowLM/examples/generate_lora.py", line 212, in main
    print(evaluate(instruction, num_beams=cfg["num_beams"], temperature=cfg["temperature"], repetition_penalty=cfg["repetition_penalty"]))
  File "/mnt/data/me/KnowLM/examples/generate_lora.py", line 193, in evaluate
    generation_output = model.generate(
  File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/transformers/generation/utils.py", line 1524, in generate
    return self.beam_search(
  File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/transformers/generation/utils.py", line 2810, in beam_search
    outputs = self(
  File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
    return forward_call(*input, **kwargs)
  File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/hooks.py", line 166, in new_forward
    return module._hf_hook.post_forward(module, output)
  File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/hooks.py", line 285, in post_forward
    output = send_to_device(output, self.input_device)
  File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/utils/operations.py", line 133, in send_to_device
    return recursively_apply(_send_to_device, tensor, device, non_blocking, test_type=_has_to_method)
  File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/utils/operations.py", line 93, in recursively_apply
    {
  File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/utils/operations.py", line 94, in <dictcomp>
    k: recursively_apply(
  File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/utils/operations.py", line 82, in recursively_apply
    return honor_type(
  File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/utils/operations.py", line 53, in honor_type
    return type(obj)(generator)
  File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/utils/operations.py", line 85, in <genexpr>
    recursively_apply(
  File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/utils/operations.py", line 82, in recursively_apply
    return honor_type(
  File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/utils/operations.py", line 53, in honor_type
    return type(obj)(generator)
  File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/utils/operations.py", line 85, in <genexpr>
    recursively_apply(
  File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/utils/operations.py", line 101, in recursively_apply
    return func(data, *args, **kwargs)
  File "/mnt/data/me/.conda/envs/knowlm/lib/python3.9/site-packages/accelerate/utils/operations.py", line 126, in _send_to_device
    return t.to(device, non_blocking=non_blocking)
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 18.00 MiB (GPU 0; 10.75 GiB total capacity; 9.45 GiB already allocated; 5.62 MiB free; 9.91 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

from knowlm.

Rolnand avatar Rolnand commented on June 8, 2024

您好,运行时请尝试添加--load_8bit,如有其他问题,请告知我 :)

from knowlm.

MikeDean2367 avatar MikeDean2367 commented on June 8, 2024

您好,建议您先使用nvidia-smi或者gpustat命令查看一下4张卡是否都有充足的显存(尽量保证四张卡剩余的显存相同),运行13B的模型至少需要26GB的显存,对于使用beam search方式,可能需要占用更多的显存。如有其他问题,请告知我 :)

from knowlm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.