[DOC]: cuda.core 1.1.1 note misstates program cache permissions

未关闭 适合新手
#2,717 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
88/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
documentation

调研方向

阅读链接的 cuda-core 1.1.1 发布说明,并将其与 cuda_core/cuda/core/utils/_program_cache/_file_stream.py 进行比较。如有需要,运行提供的 FileStreamProgramCache 示例,以验证所述权限。只有当该说明准确描述缓存根目录、条目、条目文件、tmp 目录、umask 行为以及任何已记录的共享缓存权衡时,才算完成。

由索引模型根据 Issue 内容生成。

描述

triage
  • I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct
Is this for new documentation, or an update to existing docs?

Update

Describe the incorrect/future/missing documentation

The cuda.core 1.1.1 release note says the on-disk program cache directory is created with owner-only permissions (0o700), that those permissions are re-asserted on each use, and that this prevents other local users from reading or injecting cached device code regardless of the process umask. Only the tmp/ staging directory is created 0o700. The cache root, entries/ and the shard directories inherit the umask, and no permissions are re-asserted, so a cache created under a permissive umask stays world-writable after a write.

import os, stat, tempfile
from pathlib import Path
from cuda.core.utils import FileStreamProgramCache

os.umask(0o000)
root = Path(tempfile.mkdtemp()) / "pc"
FileStreamProgramCache(path=root)["k"] = b"hello"
for p in (root, root / "entries", root / "tmp"):
    print(p.name, oct(stat.S_IMODE(os.stat(p).st_mode)))
pc 0o777
entries 0o777
tmp 0o700

Expected: the note describes what shipped. Cache entry files are 0o600 and tmp/ is 0o700, so cached device code is not readable by other users, but the cache root and entries/ follow the umask and a pre-existing shared cache directory is used as-is.

cuda_core/cuda/core/utils/_program_cache/_file_stream.py also records the trade-off this leaves (a deliberately shared writable entries/ lets a co-owner replace a cached file). Whether the note should state that as well is your call.

If this is a correction, please provide a link to the incorrect documentation. If this is a new documentation request, please link to where you have looked.

https://nvidia.github.io/cuda-python/cuda-core/latest/release/1.1.1-notes.html

主要语言
Cython
星标
3.4k
派生
329
平均合并
1 天 21 小时
30 天内合并 PR
113

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NVIDIA/cuda-python 的其他 Issue

查看 NVIDIA/cuda-python 的全部 Issue

相似的 Issue

更多 Documentation Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。