Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

Patch for codegen debugging #104

Merged
merged 2 commits into from
Nov 13, 2020

Conversation

PokhodenkoSA
Copy link

@PokhodenkoSA PokhodenkoSA commented Nov 9, 2020

Changes by @DrTodd13:
commit 2893849 - test_link()
commit 9ba9540 - use config.DEBUG_ARRAY_OPT
commit 2a9fdeb - ll.initialize_all_targets() - commit name: CSA changes.

This changes could be moved to upstream.

@PokhodenkoSA PokhodenkoSA mentioned this pull request Nov 9, 2020
50 tasks
Copy link

@DrTodd13 DrTodd13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_link is pure debugging code and is not needed anywhere at this point and so should be removed entirely. The debugging code can likewise be removed. Basically, none of these changes matter from a correctness perspective. They were all in there trying to debug a previous issue that has now been resolved. You can leave or remove the misspelling of finalize_dynamic_globals as you see fit.

@PokhodenkoSA
Copy link
Author

PokhodenkoSA commented Nov 10, 2020

There is also the call for ll.initialize_all_targets() in initialize_llvm(). What is the purpose of this?

I can remove it and test.

@PokhodenkoSA
Copy link
Author

Conclusion:

  • debuggin code will be removed
  • misspelling will be upstreamed
  • ll.initialize_all_targets() - need a comment from @DrTodd13

@DrTodd13
Copy link

There is also the call for ll.initialize_all_targets() in initialize_llvm(). What is the purpose of this?

I can remove it and test.

@PokhodenkoSA I think that was support for initializing the CSA target. I think you can safely remove it but it should be tested.

@PokhodenkoSA
Copy link
Author

You can leave or remove the misspelling of finalize_dynamic_globals as you see fit.

Moved to upstream: numba#6466


def finalize(self):
"""
Finalize the library. After this call, nothing can be added anymore.
Finalization involves various stages of code optimization and
linking.
"""
if config.DEBUG_ARRAY_OPT >= 1:
print("CodeLibrary::finalize", self._name)
#require_global_compiler_lock()
Copy link
Author

@PokhodenkoSA PokhodenkoSA Nov 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When require_global_compiler_lock() uncommented dppl tests fail:

======================================================================
FAIL: test_bool_arg (numba_dppy.tests.dppl.test_arg_types.TestDPPLArrayArgGPU)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/localdisk/work/spokhode/numba-dppy/numba_dppy/tests/dppl/test_arg_types.py", line 90, in test_bool_arg
    check_bool_kernel[global_size, dppl.DEFAULT_LOCAL_SIZE](A, True)
  File "/localdisk/work/spokhode/numba-dppy/numba_dppy/compiler.py", line 510, in __call__
    kernel = self.specialize(*args)
  File "/localdisk/work/spokhode/numba-dppy/numba_dppy/compiler.py", line 533, in specialize
    self.access_types)
  File "/localdisk/work/spokhode/numba-dppy/numba_dppy/compiler.py", line 123, in compile_kernel
    cres = compile_with_dppl(pyfunc, None, args, debug=debug)
  File "/localdisk/work/spokhode/numba-dppy/numba_dppy/compiler.py", line 111, in compile_with_dppl
    library.finalize()
  File "/localdisk/work/spokhode/numba/numba/core/codegen.py", line 255, in finalize
    require_global_compiler_lock()
  File "/localdisk/work/spokhode/numba/numba/core/compiler_lock.py", line 53, in require_global_compiler_lock
    assert global_compiler_lock.is_locked()
AssertionError

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DrTodd13 @reazulhoque
Do you know something about it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #120.

Changes by @DrTodd13:
commit 2893849 - test_link()
commit 9ba9540 - use config.DEBUG_ARRAY_OPT

This changes could be moved to upstream.
This commit fixes misspelling of _finalize_dynamic_globals().
This function is used only in the same file.
@PokhodenkoSA
Copy link
Author

Tested locally - no new test fails. Could be merged.

@PokhodenkoSA PokhodenkoSA merged commit 44cdb40 into IntelPython:pydppl Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants