Skip to content

Commit

Permalink
Merge pull request #1445 from IntelPython/main
Browse files Browse the repository at this point in the history
Merges latest changes from main to gold/2021
  • Loading branch information
diptorupd authored Apr 30, 2024
2 parents eb5bbc3 + 72a3167 commit fc1b1df
Show file tree
Hide file tree
Showing 28 changed files with 555 additions and 492 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
run: make html

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

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

- name: Publish release
if: startsWith(github.ref, 'refs/heads/release')
uses: peaceiris/actions-gh-pages@v3.9.3
uses: peaceiris/actions-gh-pages@v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
destination_dir : next_release
Expand All @@ -104,7 +104,7 @@ jobs:
- name: Publish tag
if: startsWith(github.ref, 'refs/tags/')
uses: peaceiris/actions-gh-pages@v3.9.3
uses: peaceiris/actions-gh-pages@v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
destination_dir : ${{ steps.capture_tag.outputs.tag_number }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/openssf-scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
if: ${{ github.event_name == 'push' }}
uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
uses: github/codeql-action/upload-sarif@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3
with:
sarif_file: results.sarif
9 changes: 6 additions & 3 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ requirements:
- dpctl >=0.16.1
- dpnp >=0.14
- numpy >=1.24
# TODO: there is no 2024 release for python 3.11
# - dpcpp-llvm-spirv >={{ required_compiler_version }}
- dpcpp-llvm-spirv >=2023.0
# TODO: temporary fix, because IGC is broken for output produced by llvm-spirv 2024.1 on windows
- dpcpp-llvm-spirv >={{ required_compiler_version }} # [not win]
- dpcpp-llvm-spirv >={{ required_compiler_version }},<2024.1 # [win]
- wheel >=0.43
- pip >=24.0
- python-build >=1.1
Expand All @@ -50,6 +50,9 @@ requirements:
- {{ pin_compatible('dpcpp-cpp-rt', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('intel-cmplr-lib-rt', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('dpcpp-llvm-spirv', min_pin='x.x', max_pin='x') }}
# TODO: temporary fix, because IGC is broken for output produced by llvm-spirv 2024.1 on windows
- {{ pin_compatible('dpcpp-llvm-spirv', min_pin='x.x', max_pin='x') }} # [not win]
- {{ pin_compatible('dpcpp-llvm-spirv', min_pin='x.x', max_pin='x', upper_bound='2024.1') }} # [win]
- {{ pin_compatible('dpnp', min_pin='x.x.x', max_pin='x.x') }}
- {{ pin_compatible('dpctl', min_pin='x.x.x', max_pin='x.x') }}
- {{ pin_compatible('numba', min_pin='x.x.x', max_pin='x.x') }}
Expand Down
43 changes: 43 additions & 0 deletions numba_dpex/core/debuginfo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# SPDX-FileCopyrightText: 2020 - 2024 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0

"""Implements a custom debug metadata generator class for numba-dpex kernels.
"""

from numba.core import debuginfo


class DIBuilder(debuginfo.DIBuilder):
"""Overrides Numba's default DIBuilder with numba-dpex-specific customizations."""

# pylint: disable=too-many-arguments
def mark_subprogram(self, function, qualname, argnames, argtypes, line):
"""Sets DW_AT_name and DW_AT_linkagename tags for a kernel decorated function.
Numba generates a unique name for every function it compiles, but in
upstream Numba the unique name is not used as the "qualified" name of
the function. The behavior leads to a bug discovered in Numba-dpex when
a compiled function uses closure variables.
Refer (https://github.com/IntelPython/numba-dpex/issues/898).
To resolve the issue numba-dpex uses the unique_name as the qualified
name. Refer to
:class:`numba_dpex.core.passes.passes.QualNameDisambiguationLowering`.
However, doing so breaks setting GDB breakpoints based on function
name as the function name is no longer what is in the source, but what
is the unique name generated by Numba. To fix it, numba-dpex uses a
modified DISubprogram metadata generator. The name (DW_AT_name) tag is
set to the base function name, discarding the unique qualifier and
linkagename is set to an empty string.
"""
name = qualname[0 : qualname.find("$")] # noqa: E203
argmap = dict(zip(argnames, argtypes))

di_subp = self._add_subprogram(
name=name,
linkagename="",
line=line,
function=function,
argmap=argmap,
)
function.set_metadata("dbg", di_subp)
3 changes: 3 additions & 0 deletions numba_dpex/core/descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class DpexTargetOptions(CPUTargetOptions):
no_compile = _option_mapping("no_compile")
inline_threshold = _option_mapping("inline_threshold")
_compilation_mode = _option_mapping("_compilation_mode")
# TODO: create separate parfor kernel target
_parfor_body_args = _option_mapping("_parfor_body_args")

def finalize(self, flags, options):
super().finalize(flags, options)
Expand All @@ -63,6 +65,7 @@ def finalize(self, flags, options):
_inherit_if_not_set(
flags, options, "_compilation_mode", CompilationMode.KERNEL
)
_inherit_if_not_set(flags, options, "_parfor_body_args", None)


class DpexKernelTarget(TargetDescriptor):
Expand Down
Loading

0 comments on commit fc1b1df

Please sign in to comment.