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

php通用企业网站源码怎么访问域名网站

php通用企业网站源码,怎么访问域名网站,网站建设综合实训ppt,网站目录 整理目录 背景解决方法方法一:(治标不治本)方法二:(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://www.yayakq.cn/news/591481/

相关文章:

  • 做暧暧视频网站安全吗wordpress 引用来源
  • 手机设计免费软件合肥企业网站排名优化
  • 如何设计自己网站网站开发中制作视频播放器
  • 用什么语言做网站广东省白云区邮政编码
  • 企业网站源代码下载关键词全网搜索指数
  • 小型企业网站建设内容做外贸在哪个网站找客户
  • 网站建设公司 跨界鱼科技专业学生网站建设可行性分析
  • 关于建设工程资料的网站如何把本地网站
  • 企业网站建设方讯深圳企业公司做网站
  • 网站虚拟主机空间1g多吗健康网站建设与管理
  • 贵阳网站建设外包wordpress没有登录口
  • 企业网站开发模型图海南公司网站建设哪家快
  • 运用阿里云怎么做网站苏州的网络公司网站建设
  • 广西住建局官方网站网站开发 c
  • 网站 点击量个人网站论文摘要
  • html网页制作网站从零开始学习网站建设
  • 网站网站开发需要多少钱wordpress 页面连接
  • 广州建设网站企业wordpress支持空格键
  • 推广网站制作怎么做什么叫互联网
  • 做网站前台要学什么课程征信报告
  • 做简易动画的网站网页制作方案策划
  • 合肥网站建设培训微信营销网站
  • 廊坊手机网站建设建筑公司名称大全简单大气
  • 网站建设 素材科技类网站怎么做
  • 昆山住房和城乡建设局网站首页linux 做网站数据库
  • 美业网站建设自己做网站好还是让别人做
  • wordpress建站 域名百度优化关键词
  • 一个微信小程序需要多少钱深圳 seo 外贸网站建设 多语种
  • 网站制作要学哪些成都网站开发制作
  • 网站设置的关键词网站电话素材