diplomacy_cicero icon indicating copy to clipboard operation
diplomacy_cicero copied to clipboard

E NameError: name 'FROZEN_SYM_BD' is not defined

Open dbl001 opened this issue 2 years ago • 5 comments

I am on MacOS 13.1 with an Anaconda virtual environmen: decision-transformer-gym

Where is FROZEN_SYM_BD defined?

E.g. - $vi +5 conf/conf_cfgs.py

MetaCfg = FROZEN_SYM_BD['fairdiplomacy.MetaCfg']

dbl001 avatar Jan 13 '23 18:01 dbl001

Quick note: Since you mentioned MacOS, my guess is you don't have an NVIDIA GPU and hence no CUDA, which is required for this repo. We're using Ubuntu 20.04.4 LTS, so I suggest moving to cloud (e.g. v100s or p100s on AWS) if you want to play around with this repo.

c-flaherty avatar Jan 19 '23 17:01 c-flaherty

Correct. I was trying to get the code to work with ‘MPS’. Bad idea?

On Jan 19, 2023, at 9:41 AM, Colin Flaherty @.***> wrote:

Quick note: Since you mentioned MacOS, my guess is you don't have an NVIDIA GPU and hence no CUDA, which is required for this repo. We're using Ubuntu 20.04.4 LTS, so I suggest moving to cloud (e.g. v100s or p100s on AWS) if you want to play around with this repo.

— Reply to this email directly, view it on GitHub https://github.com/facebookresearch/diplomacy_cicero/issues/20#issuecomment-1397367550, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXWFWY6ZZEW4X3PBSNC4KDWTF4FRANCNFSM6AAAAAAT2WZGE4. You are receiving this because you authored the thread.

dbl001 avatar Jan 19 '23 17:01 dbl001

What's MPS?

c-flaherty avatar Jan 19 '23 17:01 c-flaherty

‘MPS’ is Apple’s Metal Performace Shader API. ‘MPS’ is Apple’s replacement for CUDA on M1, M2, AMD, ...

On Jan 19, 2023, at 9:48 AM, Colin Flaherty @.***> wrote:

What's MPS?

— Reply to this email directly, view it on GitHub https://github.com/facebookresearch/diplomacy_cicero/issues/20#issuecomment-1397376643, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXWFWZDN2LMUY3NPRKUA3TWTF46XANCNFSM6AAAAAAT2WZGE4. You are receiving this because you authored the thread.

dbl001 avatar Jan 19 '23 17:01 dbl001

FROZEN_SYM_BD is a global defined in the conf/*_pb2.py files that is produced by the hacky protobuf patching system that runs on top of the protobuf compilter that should get run when you make. It's some global dictionary that the autogenerated protobuf python code puts stuff into.

Part of the output from grep FROZEN_SYM conf/conf_pb2.py -C 10 | less:

  _PLAYWEBDIPTASK._serialized_start=13325
  _PLAYWEBDIPTASK._serialized_end=14145
  _COMPUTEXPOWERSTATISTICSTASK._serialized_start=14148
  _COMPUTEXPOWERSTATISTICSTASK._serialized_end=14374
  _PROFILEMODELTASK._serialized_start=14377
  _PROFILEMODELTASK._serialized_end=14553
  _METACFG._serialized_start=14556
  _METACFG._serialized_end=15382
# @@protoc_insertion_point(module_scope)

if 'FROZEN_SYM_BD' not in globals():
   globals()['FROZEN_SYM_BD'] = {}
class _FrozenConf:
    heyhi_patched = True

    @classmethod
    @abc.abstractmethod
    def get_proto_class(cls) -> type:
        pass

    def __init__(self, *args, **kwargs):
        assert not args or not kwargs, "Either (msg, fields) or **kwargs"

Relevant code here: https://github.com/facebookresearch/diplomacy_cicero/blob/main/heyhi/bin/patch_protos.py

which gets run as part of this command: https://github.com/facebookresearch/diplomacy_cicero/blob/main/Makefile#L23

and which hacks the compiled protobuf files produced by protobuf to extend the functionality of the python protobuf objects (this is why the readme recommends a particular version conda install --yes go protobuf=3.19.1) and to define "frozen" i.e. immutable versions of them as well.

lightvector avatar Jan 19 '23 18:01 lightvector