Improvements to NonStationaryConvolve2D
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start by comparing the CPU implementation in pylops/signalprocessing/nonstatconvolve2d.py with the CUDA implementation in pylops/signalprocessing/_nonstatconvolve2d_cuda.py. The issue bundles interpolation refactoring, CUDA launch and iteration changes, and a new operator, without naming tests or defining a complete acceptance check; clarify the scope and expected behavior before starting.
由索引模型根据 Issue 内容生成。
描述
This issue collects a few improvements for the NonStationaryConvolve2D as raised in https://github.com/PyLops/pylops/pull/465 (and a couple of others):
-
Refactor bilinear interpolation
The CUDA bilinear interp is the same as the CPU one. It then makes sense to wrap the same code under a same function. This can be done by coding a pure Python function and then defining a device function from it. For example:# CPU def fun(a, b): return a + b # GPU dev_fun = cuda.jit(device=True)(fun) -
Move CPU to auxiliary file
Since the GPU functions are in another file and taking into account the above refactor, it makes sense to move it to another file. -
Improve thread launch parameters and iteration model
Currently, there is a limit to the size of the model, imposed by the number of blocks and threads in the call. There are two approaches to fixing this. The first is by making the total number of threads depend on the model. For example, if the model is 1000 x 1000, launch 1 block of 1024 x 1024. There is a problem which appears when very large models are used: the number of threads that are required exceed the number that the GPU can provide.
Grid stride looping can help with this as allows arbitrarily sized models to be processed by a smaller number of threads. For example, set 1 block of 1024 x 1024 and you can process any model of any size. The issue with naive grid-stride looping is that it may not be optimal in the number of threads. For example, a 32 x 32 model always launches 1024 x 1024 threads.
A solution to that is to combine both techniques: use an input-dependent number of blocks/threads (that are powers of 2), but set a maximum number of total threads launched. This can even be set per GPU, but is probably ok to hardcode for a reasonable number obtained from theMAX_GRID_DIM_Xattribute (see here). -
Create operator that takes filters as input
Currently, our operator takes a generic 2d signal as input and filters as parameter. However, an alternative operator that takes the 2d signal as parameter and the filters as inputs is desirable as it could be used to estimate the best non-stationary filters that match a given data and input signal. This is kind of equivalent topylops.avo.prestack.PrestackWaveletModellingfor the 1D case. I suggest making a completely new operator and calling itNonStationaryWavelets2DorNonStationaryFilters2D.
- 主要语言
- Python
- 星标
- 539
- 派生
- 126
- 平均合并
- 2 天 17 小时
- 30 天内合并 PR
- 21
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PyLops/pylops 的其他 Issue
-
Lipschitz method可能已有人在做 @Megumi1773 于 25 天前认领。 未关闭enhancement good first issue
难度 4/5 3-5 天 新手友好度 25/100
维护者通常 2 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 45/100
维护者通常 2 天内回复
-
CI
难度 3/5 1-2 天 新手友好度 52/100
维护者通常 2 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 25/100
维护者通常 2 天内回复
-
难度 3/5 1-2 天 新手友好度 38/100
PyLops/pylops#731 · 4 条评论 · 1 个 reaction ·
维护者通常 2 天内回复
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
yt-project/yt#5624 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
NousResearch/hermes-agent#148376 ·
维护者通常 1 天内回复
-
Analysis
难度 2/5 1-3 小时 新手友好度 72/100
SACGF/variantgrid#2615 ·
维护者通常 1 天内回复