Skip to content

Parallel LCD computation fails on macOS #91

@dgazzoni

Description

@dgazzoni

Configuration: OSACA 0.4.13 running on macOS Ventura 13.2 using the system Python 3.9.6. Also happens on the Homebrew-installed Python 3.10.9 and 3.11.1.

Just create any large (> 50 instructions) kernel and try to run OSACA. The following error is output:

Traceback (most recent call last):
  File "/usr/local/bin/osaca", line 8, in <module>
    sys.exit(main())
  File "/Library/Python/3.9/site-packages/osaca/osaca.py", line 431, in main
    run(args, output_file=args.out)
  File "/Library/Python/3.9/site-packages/osaca/osaca.py", line 380, in run
    inspect(args, output_file=output_file)
  File "/Library/Python/3.9/site-packages/osaca/osaca.py", line 336, in inspect
    kernel_graph = KernelDG(kernel, parser, machine_model, semantics, args.lcd_timeout)
  File "/Library/Python/3.9/site-packages/osaca/semantics/kernel_dg.py", line 32, in __init__
    self.loopcarried_deps = self.check_for_loopcarried_dep(self.kernel, timeout)
  File "/Library/Python/3.9/site-packages/osaca/semantics/kernel_dg.py", line 133, in check_for_loopcarried_dep
    p.start()
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/multiprocessing/context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/multiprocessing/context.py", line 284, in _Popen
    return Popen(process_obj)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 47, in _launch
    reduction.dump(process_obj, fp)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object '_trim_arity.<locals>.wrapper'

On the other hand, the issue does not happen with OSACA 0.4.13 on a Raspberry Pi 4 running Ubuntu Linux 22.04, with Python 3.10.6.

My understanding is that it is related to the parallel LCD computation feature. Some research appears to indicate that _trim_arity comes from the pyparsing package.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions