XENONnT / epix

Electron and Photon Instructions generator for XENON
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Numba - Awkward Array Version Problem #67

Closed HenningSE closed 8 months ago

HenningSE commented 1 year ago

Looks like @cfuselli found a problem with numba and/or awkward:

(XENONnT_development) ../epix/bin/run_epix --InputFile /home/cfuselli/software/mc/events.root --Debug
*** Detector definition message ***
You are currently using the default XENON10 template detector.

Using nestpy version 2.0.0
epix configuration:  {'input_file': '/home/cfuselli/software/mc/events.root', 'detector': 'XENONnT', 'detector_config_override': '', 'cut_by_eventid': False, 'nr_only': False, 'entry_start': None, 'entry_stop': None, 'micro_separation': 0.005, 'micro_separation_time': 10, 'tag_cluster_by': 'energy', 'max_delay': 10000000.0, 'source_rate': 0, 'yield': 'nest', 'job_number': 0, 'output_path': '', 'debug': True, 'path': '/home/cfuselli/software/mc', 'file_name': 'events.root', 'detector_config': [<epix.detector_volumes.SensitiveVolume object at 0x7f14ae0e9ac0>, <epix.detector_volumes.SensitiveVolume object at 0x7f14ae0e9d60>], 'outer_cylinder': {'max_z': 7.3936, 'min_z': -154.6555, 'max_r': 66.4}}
Total entries in input file = 500
It took 48.4048 sec to load data.
Finding clusters of interactions with a dr = 0.005 mm and dt = 10 ns
/opt/XENONnT/anaconda/envs/XENONnT_development/lib/python3.8/site-packages/awkward/_connect/_numba/__init__.py:28: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if not checked_version and distutils.version.LooseVersion(
/opt/XENONnT/anaconda/envs/XENONnT_development/lib/python3.8/site-packages/awkward/_connect/_numba/__init__.py:30: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  ) < distutils.version.LooseVersion("0.50"):
It took 10.0623 sec to find clusters.
Traceback (most recent call last):
  File "../epix/bin/run_epix", line 71, in <module>
    epix.run_epix.main(args, return_df=True)
  File "/home/cfuselli/software/epix/epix/run_epix.py", line 45, in main
    result = epix.cluster(inter, args['tag_cluster_by'] == 'energy')
  File "/home/cfuselli/software/epix/epix/clustering.py", line 164, in cluster
    _cluster(x, y, z, ed, time, ci,
  File "/opt/XENONnT/anaconda/envs/XENONnT_development/lib/python3.8/site-packages/numba/core/dispatcher.py", line 468, in _compile_for_args
    error_rewrite(e, 'typing')
  File "/opt/XENONnT/anaconda/envs/XENONnT_development/lib/python3.8/site-packages/numba/core/dispatcher.py", line 409, in error_rewrite
    raise e.with_traceback(None)
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Internal error at <numba.core.typeinfer.CallConstraint object at 0x7f1475f41460>.
Failed in nopython mode pipeline (step: native lowering)
module 'llvmlite' has no attribute 'llvmpy'

File "../epix/epix/clustering.py", line 302:
def _write_result(res, x_mean, y_mean, z_mean,
    <source elided>
    res.begin_record()
    res.field('x')
    ^

During: lowering "$16call_method.6 = call $12load_method.4($const14.5, func=$12load_method.4, args=[Var($const14.5, clustering.py:302)], kws=(), vararg=None, varkwarg=None, target=None)" at /home/cfuselli/software/epix/epix/clustering.py (302)
During: resolving callee type: type(CPUDispatcher(<function _write_result at 0x7f14ae0d05e0>))
During: typing of call at /home/cfuselli/software/epix/epix/clustering.py (211)

Enable logging at debug level for details.

File "../epix/epix/clustering.py", line 211:
def _cluster(x, y, z, ed, time, ci,
    <source elided>
                # Write result, simple but extensive with awkward...
                _write_result(res, x_mean, y_mean, z_mean,
                ^
HenningSE commented 1 year ago

The problem looks similar to https://github.com/XENONnT/epix/issues/58

ramirezdiego commented 8 months ago

Fixed in https://github.com/XENONnT/epix/pull/77.