pytorch

ROCm

Building PyTorch for ROCm
官方文档AMD ROCm Release Notes v3.1.0
rocminfo

$ /opt/rocm/bin/rocminfo 
ROCk module is loaded
<你的用户名> is member of video group
hsa api call failure at: /data/jenkins_workspace/compute-rocm-rel-2.9/rocminfo/rocminfo.cc:1102
Call returned HSA_STATUS_ERROR_OUT_OF_RESOURCES: The runtime failed to allocate the necessary resources. This error may also occur when the core runtime library needs to spawn threads or create internal OS-specific events.

检查是否能够以sudo形式运行,

$ sudo /opt/rocm/bin/rocminfo 

如果可以的话编译pytorch还是可以继续的,但是之后的所有命令都需要sudo权限.

具体编译过程到处鼓捣半天发现csdn上一篇博客已经面面俱到了

Aten

wiki

aten/src/ATen/native/

  • native_functions.yaml:将函数dispatch到不同的devices上时对应的算子,并指定autogen,比如sum autogen为sum.out
  • tags.yamlnative_functions.yaml中的tags
  • ReduceOps.cpp:在infer_dtype_from_optional中调用get_dtype_from_self或者选择result.scalar_type(),但是dtype一旦指定就会使用dtype的值
  • ReduceOpsUtils.h
    • get_dtype_from_self会对dtype做类型提升,比如bool会转为int64kLong
    • get_dtype_from_result
Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐