MetaX-Tech Developer Forum
  • 沐曦开发者
search
Sign in

lihz

  • Members
  • Joined 2025年8月28日
  • message 帖子
  • forum 主题
  • favorite 关注者
  • favorite_border Follows
  • person_outline 详细信息

lihz has started 3 threads.

  • See post chevron_right
    lihz
    Members
    指定卡环境变量失效 公共 2025年9月4日 16:56

    使用镜像cr.metax-tech.com/public-ai-release/maca/vllm:maca.ai3.0.0.5-torch2.6-py310-ubuntu22.04-amd64启动的容器中,使用METAX_VISIBLE_DEVICES环境变量指定GPU失败。使用CUDA_VISIBLE_DEVICES则可以成功指定运行的GPU。目前其他镜像没有发现有这个问题,这个是新版vllm镜像做的调整吗?

  • See post chevron_right
    lihz
    Members
    关于环境变量 公共 2025年9月2日 09:52

    沐曦有可以限制进程使用的显存大小的环境变量吗?
    还有什么其他的常用的环境变量?

  • See post chevron_right
    lihz
    Members
    注意力头部测试问题 已解决 2025年8月28日 14:39
    1. 在做注意力头部测试时发现,
      query_states shape: [8, 16, 1, 24]
      key_states shape: [8, 16, 1, 24]
      value_states shape: [8, 16, 1, 48]
      dtype为float16时,torch.nn.functional.scaled_dot_product_attention会报错:
      Head dimension of query/key must greater or equal to head dimension in query。
      dtype 为float32时则不会报错。
    2. 宿主机环境:
      CPU:Intel(R) Xeon(R) Gold 5318Y 2
      内存:256GB(32GB
      8)
      GPU:N260*2
      OS:Ubuntu 22.04.4 LTS
      内核:5.15.0-88-generic
      MACA:3.0.0.8
      vBIOS:1.26.1.0
      docker:27.5.1
    3. 容器环境:
      cr.metax-tech.com/public-ai-release/maca/vllm:maca.ai3.0.0.5-torch2.6-py310-ubuntu22.04-amd64
      cr.metax-tech.com/public-ai-release/maca/sglang:maca.ai2.33.1.7-torch2.6-py310-ubuntu22.04-amd64
    4. 简单测试内容介绍
      后面在做测试发现在sglang的容器内会出现上述报错,而在vllm容器中不会出现上述报错。使用附件中的test1(上传限制需要修改为.py文件运行。)可稳定复现。
      后续在代码中添加下面全局开关后:
      torch.backends.cuda.enable_flash_sdp(False)
      torch.backends.cuda.enable_mem_efficient_sdp(False)
      torch.backends.cuda.enable_math_sdp(True)
      在sglang和vllm容器中就不会在出现上述报错。使用附件中的test2复现。
      在后续测试中发现即使设置了上面的全局开关,在使用 flash_attn_func 时还是会出现上述错误。附件test3可稳定复现。
    5. 回显:
      成功及报错回显可查看附件中的截图。
  • 沐曦开发者论坛
powered by misago