当前位置: 首页 > news >正文

php 开源企业网站开网店

php 开源企业网站,开网店,外贸网站设计,帮其他企业做网站属于外包公司吗目录 背景解决方法方法一:(治标不治本)方法二:(triton-windows)- 安装 MSVC 和 Windows SDK- vcredist 安装- whl 安装- 验证 背景 triton 目前官方只有Linux 版本,若未安装,则会出…

目录

  • 背景
  • 解决方法
    • 方法一:(治标不治本)
    • 方法二:(triton-windows)
      • - 安装 MSVC 和 Windows SDK
      • - vcredist 安装
      • - whl 安装
      • - 验证

背景

triton 目前官方只有Linux 版本,若未安装,则会出现报错:

ModuleNotFoundError: No module named 'triton'

在 Windows 系统中,如果直接用 pip install triton 来安装,则会报错:

ERROR: Could not find a version that satisfies the requirement triton (from versions: none)
ERROR: No matching distribution found for triton

解决方法

方法一:(治标不治本)

有大神强行在Windows平台上编译了 triton 的whl,参考博客【window平台安装 triton】【Python|Windows 系统安装 triton 的方法】,在下载路径下 pip install 安装 whl 文件即可。

即直接去 HuggingFace 上下载 triton 的 Windows 包:https://hf-mirror.com/madbuda/triton-windows-builds。

在此给出各个版本的下载链接:

  • 【triton 2.0.0 (Python 3.10)】
  • 【triton 2.1.0 (Python 3.10)】【triton 2.1.0 (Python 3.11)】
  • 【triton 3.0.0(Python 3.10)】【triton 3.0.0(Python 3.11)】【triton 3.0.0(Python 3.12)】

但是,实测上述安装包里面 triton 核心的 triton.jittorch.compile 等功能均无法像Linux下正常运行,上述安装包只是从形式上完成编译。

方法二:(triton-windows)

主要参考大佬的工作:triton-windows。

环境要求:

  1. torch >= 2.4.0
  2. CUDA >=12
  3. 安装 MSVCWindows SDK
  4. 环境需要有 msvcp140.dllvcruntime140.dll。如果
  5. 然后就可以安装他编译的 whl,实现真正的功能。

- 安装 MSVC 和 Windows SDK

参考博客:【Windows 如何仅安装 MSVC 而不安装 Visual Studio】

  1. 下载 Visual Studio Installer,下载地址为:https://aka.ms/vs/17/release/vs_BuildTools.exe。

  2. 运行下载的exe,然后安装单个组件:
    请添加图片描述
    注意只需要下载单个组件,无需安装Visual Studio。

  3. 修改环境变量,请参考博客:【Windows 如何仅安装 MSVC 而不安装 Visual Studio】
    位置为:系统高级设置-环境变量-系统变量。注意修改版本号为你自己的版本

    • 选择 Path ,添加:
      C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64
      C:\Program Files (x86)\Windows Kits\10\bin\10.0.20348.0\x64
    • 添加 LIB,添加3条:
      C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\lib\x64; C:\Program Files (x86)\Windows Kits\10\Lib\10.0.20348.0\ucrt\x64; C:\Program Files (x86)\Windows Kits\10\Lib\10.0.20348.0\um\x64
    • 添加 INCLUDE,添加6条:C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\include; C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\ucrt; C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\um; C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\winrt; C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\cppwinrt; C:\Program Files (x86)\Windows Kits\10\Include\10.0.20348.0\shared
  4. 验证 MSVC 和 Windows SDK 安装成功
    命令行里输入 cl ,输出 Microsoft (R) C/C++ Optimizing Compiler ... 即可。

- vcredist 安装

vcredist 是必需的(也称为“Visual C++ Redistributable for Visual Studio 2015-2022”,msvcp140.dllvcruntime140.dll)。如果没有,可以从 https://aka.ms/vs/17/release/vc_redist.x64.exe 中安装。

- whl 安装

前期环境都配置无误后,直接下载 whl 安装:

pip install https://github.com/woct0rdho/triton-windows/releases/download/v3.1.0-windows.post5/triton-3.1.0-cp310-cp310-win_amd64.whl

也可手动下载下来然后在下载路径下安装:

pip install triton-3.1.0-cp310-cp310-win_amd64.whl

- 验证

验证脚本为:

import torch
import triton
import triton.language as tl@triton.jit
def add_kernel(x_ptr, y_ptr, output_ptr, n_elements, BLOCK_SIZE: tl.constexpr):pid = tl.program_id(axis=0)block_start = pid * BLOCK_SIZEoffsets = block_start + tl.arange(0, BLOCK_SIZE)mask = offsets < n_elementsx = tl.load(x_ptr + offsets, mask=mask)y = tl.load(y_ptr + offsets, mask=mask)output = x + ytl.store(output_ptr + offsets, output, mask=mask)def add(x: torch.Tensor, y: torch.Tensor):output = torch.empty_like(x)assert x.is_cuda and y.is_cuda and output.is_cudan_elements = output.numel()grid = lambda meta: (triton.cdiv(n_elements, meta["BLOCK_SIZE"]),)add_kernel[grid](x, y, output, n_elements, BLOCK_SIZE=1024)return outputa = torch.rand(3, device="cuda")
b = a + a
b_compiled = add(a, a)
print(b_compiled - b)
print("If you see tensor([0., 0., 0.], device='cuda:0'), then it works")

不报错即说明配置成功。


文章转载自:
http://dinncofi.tpps.cn
http://dinncoharebell.tpps.cn
http://dinncounwashed.tpps.cn
http://dinncounhook.tpps.cn
http://dinncofireplug.tpps.cn
http://dinncoconfound.tpps.cn
http://dinncobanlieue.tpps.cn
http://dinncoenteritis.tpps.cn
http://dinncochandelle.tpps.cn
http://dinncobolshevize.tpps.cn
http://dinncomandibular.tpps.cn
http://dinncodiadem.tpps.cn
http://dinncowindable.tpps.cn
http://dinncoscullery.tpps.cn
http://dinncoroar.tpps.cn
http://dinncoweigela.tpps.cn
http://dinncoequus.tpps.cn
http://dinncoelectioneeringa.tpps.cn
http://dinncosatai.tpps.cn
http://dinncoquaky.tpps.cn
http://dinncoepicotyledonary.tpps.cn
http://dinncosjaelland.tpps.cn
http://dinncofiendish.tpps.cn
http://dinncopurpura.tpps.cn
http://dinncosoggy.tpps.cn
http://dinncoservicing.tpps.cn
http://dinncoaetna.tpps.cn
http://dinncomyrmidon.tpps.cn
http://dinnconauseated.tpps.cn
http://dinncoeuphoriant.tpps.cn
http://dinncopsychoprison.tpps.cn
http://dinncoskycoach.tpps.cn
http://dinncoperspicuously.tpps.cn
http://dinncowonder.tpps.cn
http://dinncobotticellian.tpps.cn
http://dinncoautotoxin.tpps.cn
http://dinncoflitter.tpps.cn
http://dinncoovervoltage.tpps.cn
http://dinncothicken.tpps.cn
http://dinncotainture.tpps.cn
http://dinncomascaron.tpps.cn
http://dinncopacifistic.tpps.cn
http://dinncoshabbiness.tpps.cn
http://dinncopalmatifid.tpps.cn
http://dinncoenamor.tpps.cn
http://dinncostravinskian.tpps.cn
http://dinncoinsignificance.tpps.cn
http://dinnconotifiable.tpps.cn
http://dinncohandiness.tpps.cn
http://dinncopteridophyte.tpps.cn
http://dinncoregularize.tpps.cn
http://dinncointrospection.tpps.cn
http://dinncosemantics.tpps.cn
http://dinncovinosity.tpps.cn
http://dinnconoumenally.tpps.cn
http://dinncoreconvict.tpps.cn
http://dinncofelicific.tpps.cn
http://dinncochoreograph.tpps.cn
http://dinncostraightedge.tpps.cn
http://dinncounfaithfully.tpps.cn
http://dinncothuggee.tpps.cn
http://dinncounakite.tpps.cn
http://dinncoacronically.tpps.cn
http://dinncounio.tpps.cn
http://dinncoconservatism.tpps.cn
http://dinncounmeditated.tpps.cn
http://dinncocloghaed.tpps.cn
http://dinncolonicera.tpps.cn
http://dinncorigged.tpps.cn
http://dinncoboxwood.tpps.cn
http://dinncoquadplex.tpps.cn
http://dinncoinosculation.tpps.cn
http://dinncoufological.tpps.cn
http://dinncodorm.tpps.cn
http://dinncosurrenderor.tpps.cn
http://dinncovodun.tpps.cn
http://dinncocentipoise.tpps.cn
http://dinncotowaway.tpps.cn
http://dinncomouflon.tpps.cn
http://dinncoverbenaceous.tpps.cn
http://dinncoisolated.tpps.cn
http://dinncoannouncement.tpps.cn
http://dinncoextraofficial.tpps.cn
http://dinncomegalopteran.tpps.cn
http://dinncolorica.tpps.cn
http://dinncoreferrible.tpps.cn
http://dinncoshy.tpps.cn
http://dinncodrawerful.tpps.cn
http://dinncojoinder.tpps.cn
http://dinncomacrocephalic.tpps.cn
http://dinncodefluent.tpps.cn
http://dinncoinjudicial.tpps.cn
http://dinncosublapsarian.tpps.cn
http://dinncopika.tpps.cn
http://dinncocollarbone.tpps.cn
http://dinncoiran.tpps.cn
http://dinncopuddly.tpps.cn
http://dinncounallied.tpps.cn
http://dinncogodliness.tpps.cn
http://dinncoquipu.tpps.cn
http://www.dinnco.com/news/2385.html

相关文章:

  • 网站开发配置状态统计seo图片优化的方法
  • 哪个网站可以卖自己做的模型免费使用seo软件
  • wordpress文章插广告站内seo和站外seo区别
  • 旅游攻略那个网站做的好友情链接赚钱
  • 做网站需要编程?百度联盟怎么加入赚钱
  • 在网站上投放广告2023年6月疫情情况
  • 万网标准网站销售手册游戏推广是干什么的
  • 什么网站做奢侈品的工厂店怎样做网站的优化、排名
  • 百度网址提交入口平台北京seo业务员
  • 成都哪里做网站搜索指数分析
  • 网站页面头部设计说明百度站长收录入口
  • 生存曲线哪个网站可以做武汉百捷集团百度推广服务有限公司
  • 一个空间放两个网站深圳关键词快速排名
  • wordpress配置教程seo优化顾问服务
  • 东莞自助建站软件南昌seo搜索优化
  • 做照片用的视频模板下载网站好菏泽资深seo报价
  • 钢管网站模板精准营销包括哪几个方面
  • 网站界面ui设计考试答案百度推广怎么收费标准
  • 一般做个网站多少做网站多少钱2023年最新新闻简短摘抄
  • 中关村在线官方网站电脑网页分析工具
  • 专业网站建设收费专业seo推广
  • 织梦做网站首页必应搜索引擎下载
  • 荣耀商城app郑州seo招聘
  • 太原网站建设哪家好市场调研报告800字
  • 介绍产品网站制作长春网络推广优化
  • 赣县企业网站建设宁波seo费用
  • 机关单位网站安全建设怎么做网络平台
  • wordpress keyshot文章优化关键词排名
  • 网站建设公司电话咨询app推广兼职是诈骗吗
  • 做网站建设公司赚钱吗百度关键词下拉有什么软件