Skip to content

Commit fc1b1df

Browse files
author
Diptorup Deb
authored
Merge pull request #1445 from IntelPython/main
Merges latest changes from main to gold/2021
2 parents eb5bbc3 + 72a3167 commit fc1b1df

28 files changed

+555
-492
lines changed

.github/workflows/gh-pages.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
run: make html
5252

5353
- name: GitHub Pages [main]
54-
uses: peaceiris/actions-gh-pages@v3.9.3
54+
uses: peaceiris/actions-gh-pages@v4.0.0
5555
if: ${{ github.ref == 'refs/heads/main' }}
5656
with:
5757
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -64,7 +64,7 @@ jobs:
6464
user_email: 'github-actions[bot]@users.noreply.github.com'
6565

6666
- name: GitHub Pages [PR]
67-
uses: peaceiris/actions-gh-pages@v3.9.3
67+
uses: peaceiris/actions-gh-pages@v4.0.0
6868
if: ${{ github.event.pull_request && github.event.action != 'closed' }}
6969
with:
7070
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -88,7 +88,7 @@ jobs:
8888

8989
- name: Publish release
9090
if: startsWith(github.ref, 'refs/heads/release')
91-
uses: peaceiris/actions-gh-pages@v3.9.3
91+
uses: peaceiris/actions-gh-pages@v4.0.0
9292
with:
9393
github_token: ${{ secrets.GITHUB_TOKEN }}
9494
destination_dir : next_release
@@ -104,7 +104,7 @@ jobs:
104104
105105
- name: Publish tag
106106
if: startsWith(github.ref, 'refs/tags/')
107-
uses: peaceiris/actions-gh-pages@v3.9.3
107+
uses: peaceiris/actions-gh-pages@v4.0.0
108108
with:
109109
github_token: ${{ secrets.GITHUB_TOKEN }}
110110
destination_dir : ${{ steps.capture_tag.outputs.tag_number }}

.github/workflows/openssf-scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@ jobs:
7171
# Upload the results to GitHub's code scanning dashboard.
7272
- name: "Upload to code-scanning"
7373
if: ${{ github.event_name == 'push' }}
74-
uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
74+
uses: github/codeql-action/upload-sarif@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3
7575
with:
7676
sarif_file: results.sarif

conda-recipe/meta.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ requirements:
3737
- dpctl >=0.16.1
3838
- dpnp >=0.14
3939
- numpy >=1.24
40-
# TODO: there is no 2024 release for python 3.11
41-
# - dpcpp-llvm-spirv >={{ required_compiler_version }}
42-
- dpcpp-llvm-spirv >=2023.0
40+
# TODO: temporary fix, because IGC is broken for output produced by llvm-spirv 2024.1 on windows
41+
- dpcpp-llvm-spirv >={{ required_compiler_version }} # [not win]
42+
- dpcpp-llvm-spirv >={{ required_compiler_version }},<2024.1 # [win]
4343
- wheel >=0.43
4444
- pip >=24.0
4545
- python-build >=1.1
@@ -50,6 +50,9 @@ requirements:
5050
- {{ pin_compatible('dpcpp-cpp-rt', min_pin='x.x', max_pin='x') }}
5151
- {{ pin_compatible('intel-cmplr-lib-rt', min_pin='x.x', max_pin='x') }}
5252
- {{ pin_compatible('dpcpp-llvm-spirv', min_pin='x.x', max_pin='x') }}
53+
# TODO: temporary fix, because IGC is broken for output produced by llvm-spirv 2024.1 on windows
54+
- {{ pin_compatible('dpcpp-llvm-spirv', min_pin='x.x', max_pin='x') }} # [not win]
55+
- {{ pin_compatible('dpcpp-llvm-spirv', min_pin='x.x', max_pin='x', upper_bound='2024.1') }} # [win]
5356
- {{ pin_compatible('dpnp', min_pin='x.x.x', max_pin='x.x') }}
5457
- {{ pin_compatible('dpctl', min_pin='x.x.x', max_pin='x.x') }}
5558
- {{ pin_compatible('numba', min_pin='x.x.x', max_pin='x.x') }}

numba_dpex/core/debuginfo.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# SPDX-FileCopyrightText: 2020 - 2024 Intel Corporation
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
"""Implements a custom debug metadata generator class for numba-dpex kernels.
6+
"""
7+
8+
from numba.core import debuginfo
9+
10+
11+
class DIBuilder(debuginfo.DIBuilder):
12+
"""Overrides Numba's default DIBuilder with numba-dpex-specific customizations."""
13+
14+
# pylint: disable=too-many-arguments
15+
def mark_subprogram(self, function, qualname, argnames, argtypes, line):
16+
"""Sets DW_AT_name and DW_AT_linkagename tags for a kernel decorated function.
17+
18+
Numba generates a unique name for every function it compiles, but in
19+
upstream Numba the unique name is not used as the "qualified" name of
20+
the function. The behavior leads to a bug discovered in Numba-dpex when
21+
a compiled function uses closure variables.
22+
Refer (https://github.com/IntelPython/numba-dpex/issues/898).
23+
To resolve the issue numba-dpex uses the unique_name as the qualified
24+
name. Refer to
25+
:class:`numba_dpex.core.passes.passes.QualNameDisambiguationLowering`.
26+
However, doing so breaks setting GDB breakpoints based on function
27+
name as the function name is no longer what is in the source, but what
28+
is the unique name generated by Numba. To fix it, numba-dpex uses a
29+
modified DISubprogram metadata generator. The name (DW_AT_name) tag is
30+
set to the base function name, discarding the unique qualifier and
31+
linkagename is set to an empty string.
32+
"""
33+
name = qualname[0 : qualname.find("$")] # noqa: E203
34+
argmap = dict(zip(argnames, argtypes))
35+
36+
di_subp = self._add_subprogram(
37+
name=name,
38+
linkagename="",
39+
line=line,
40+
function=function,
41+
argmap=argmap,
42+
)
43+
function.set_metadata("dbg", di_subp)

numba_dpex/core/descriptor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ class DpexTargetOptions(CPUTargetOptions):
4848
no_compile = _option_mapping("no_compile")
4949
inline_threshold = _option_mapping("inline_threshold")
5050
_compilation_mode = _option_mapping("_compilation_mode")
51+
# TODO: create separate parfor kernel target
52+
_parfor_body_args = _option_mapping("_parfor_body_args")
5153

5254
def finalize(self, flags, options):
5355
super().finalize(flags, options)
@@ -63,6 +65,7 @@ def finalize(self, flags, options):
6365
_inherit_if_not_set(
6466
flags, options, "_compilation_mode", CompilationMode.KERNEL
6567
)
68+
_inherit_if_not_set(flags, options, "_parfor_body_args", None)
6669

6770

6871
class DpexKernelTarget(TargetDescriptor):

0 commit comments

Comments
 (0)