[RFC]: mismatch between BLAS band storage and `to-compact` layout
维护者通常 1 天内回复
还没有人认领这个 Issue。
- #10865 来自 @DivitJain26 —— 已关闭,未合并
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript
- 领域
- data
调研方向
从 @stdlib/array/base/banded/to-compact 入口点以及 issue 中提到的 blas/base/cgbmv 实现开始。将它们的 colexicographic 存储约定与链接的 BLAS 文档进行比较,然后检查相关 issue 和包测试。当明确决定预期的按列布局,并且观察到的输出与该决定一致时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Description
Description
While implementing blas/base/cgbmv, I noticed that the band matrix storage format expected by BLAS gbmv differs from the layout produced by @stdlib/array/base/banded/to-compact.
to-compact produces a diagonal-centered layout, whereas BLAS expects a band storage layout compatible with the gbmv routines (as documented in (Intel® oneAPI Math Kernel Library).
Because of this difference, to-compact cannot be directly used for preparing matrices for gbmv.
This behaviour is only present in colexicographic or column wise packing.
For example, given:
var A = [
[ 1, 2, 3, 0, 0 ],
[ -2, 4, 5, 6, 0 ],
[ -3, -5, 7, 8, 9 ],
[ 0, -6, -8, 10, 11 ],
[ 0, 0, -9,-11, 12 ]
];
Output from to-compact
Column wise (colexicographic) packing
AC = toCompact( A, 2, 2, true );
/* e.g., returns =>
[
[ 0, 0, 1, -2, -3 ],
[ 0, 2, 4, -5, -6 ],
[ 3, 5, 7, -8, -9 ],
[ 6, 8, 10, -11, 0 ],
[ 9, 11, 12, 0, 0 ]
]
*/
Expected BLAS band storage (MKL / Netlib)
BLAS gbmv expects band matrices packed differently.
Band Matrix
A general band matrix A of m rows and n columns with kl sub-diagonals, ku super-diagonals and leading dimension lda is represented as a one dimensional array a of size at least lda * n (respectively, lda * m) if column (respectively, row) major layout is used.
Before entry in any BLAS function using a general band matrix, the leading (kl + ku + 1) by n (respectively, m) part of the array a must contain the matrix A. This matrix must be supplied column-by-column (respectively, row-by-row), with the main diagonal of the matrix in row ku (respectively, column kl) of the array (0-based indexing), the first super-diagonal starting at position 1 (respectively, 0) in row (ku – 1) (respectively, column (kl + 1)), the first sub-diagonal starting at position 0 (respectively, 1) in row (ku + 1) (respectively, column (kl – 1)), and so on. Elements in the array a that do not correspond to elements in the band matrix (such as the top left ku-by-ku triangle) are not referenced.
Acompact = [
[ 0, 0, 1, 2, 3 ],
[ 0, -2, 4, 5, 6 ],
[ -3, -5, 7, 8, 9 ],
[ -6, -8, 10, 11, 0 ],
[ -9, -11, 12, 0, 0 ]
]
Related Issues
Related issues # , # , and # .
Questions
No.
Demo
No response
Reproduction
var toCompact = require('@stdlib/array/base/banded/to-compact');
var A = [
[ 1, 2, 3, 0, 0 ],
[ -2, 4, 5, 6, 0 ],
[ -3, -5, 7, 8, 9 ],
[ 0, -6, -8, 10, 11 ],
[ 0, 0, -9,-11, 12 ]
];
var AC = toCompact( A, 2, 2, true );
console.log( AC );
Expected Results
[
[ 0, 0, 1, 2, 3 ],
[ 0, -2, 4, 5, 6 ],
[ -3, -5, 7, 8, 9 ],
[ -6, -8, 10, 11, 0 ],
[ -9, -11, 12, 0, 0 ]
]
Actual Results
[
[ 0, 0, 1, -2, -3 ],
[ 0, 2, 4, -5, -6 ],
[ 3, 5, 7, -8, -9 ],
[ 6, 8, 10, -11, 0 ],
[ 9, 11, 12, 0, 0 ]
]
Version
No response
Environments
Node.js
Browser Version
No response
Node.js / npm Version
20.20.0
Platform
Linux
Checklist
- Read and understood the Code of Conduct.
- Searched for existing issues and pull requests.
- 主要语言
- JavaScript
- 星标
- 6k
- 派生
- 1.3k
- 平均合并
- 1 天 21 小时
- 30 天内合并 PR
- 224
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
stdlib-js/stdlib 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
stdlib-js/stdlib#16655 · 1 条评论 ·
维护者通常 1 天内回复
-
Fix JavaScript lint errors可能已有人在做 @protestershankar 于 5 天前认领。 未关闭Good First Issue
难度 2/5 1-3 小时 新手友好度 82/100
stdlib-js/stdlib#16563 · 3 条评论 ·
维护者通常 1 天内回复
-
Fix C lint errors可能已有人在做 @raus7n 于 14 天前认领。 未关闭Good First Issue
难度 1/5 1 小时以内 新手友好度 82/100
stdlib-js/stdlib#16454 · 1 条评论 ·
维护者通常 1 天内回复
-
Fix JavaScript lint errors可能已有人在做 @Devansh-18155 于 39 天前认领。 未关闭Good First Issue
难度 1/5 1 小时以内 新手友好度 82/100
stdlib-js/stdlib#15970 · 1 条评论 ·
维护者通常 1 天内回复
-
Fix JavaScript lint errors可能已有人在做 @lb1192176991-lab 于 44 天前认领。 未关闭Good First Issue
难度 1/5 1 小时以内 新手友好度 90/100
stdlib-js/stdlib#15831 · 2 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 69/100
维护者通常 1 天内回复
-
automation chore ci-cd consistency developer-experience difficulty: easy discoverability documentation enhancement github-actions good first issue help wanted hygiene priority: P3 seo shell yaml
难度 1/5 1 小时以内 新手友好度 76/100
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
swc-project/swc-next-issues#394 ·
-
难度 1/5 1-3 小时 新手友好度 88/100
githubnext/gh-aw-workshop#5790 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
adobe/helix-tools-website#480 ·
维护者通常 1 天内回复