Skip to content

Missing alpha for a node at the beginning of BaB #106

Description

@ilpleutdehors

Describe the bug
During the branch and bound operation, at least one node does not exist in the dictionary mapping each node to an alpha, as if its alpha was not computed beforehand in the main function of abcrown.py.
It results in a KeyError.

To Reproduce

  1. You can find the files to reproduce the error attached to this issue. You just have to extract them in the alpha-beta-crown/complete-verifier directory.
    keyerror.zip
  2. Then, you have to run them with the command python abcrown.py --config keyerror/config_keyerror_in_a.yaml. An error should appear.
  3. This is the error that is raised when running the example.
Traceback (most recent call last):
  File "~/alpha-beta-CROWN/complete_verifier/abcrown.py", line 414, in <module>
    abcrown.main()
  File "~/alpha-beta-CROWN/complete_verifier/abcrown.py", line 368, in main
    verified_status = self.complete_verifier(
                      ^^^^^^^^^^^^^^^^^^^^^^^
  File "~/alpha-beta-CROWN/complete_verifier/complete_verifier_func.py", line 211, in complete_verifier
    l, num_domains_visited, ret = self.bab(
                                  ^^^^^^^^^
  File "~/alpha-beta-CROWN/complete_verifier/complete_verifier_func.py", line 142, in bab
    batch_result = general_bab(
                   ^^^^^^^^^^^^
  File "~/alpha-beta-CROWN/complete_verifier/activation_split/bab_bootstrap.py", line 255, in general_bab
    compute_first_iteration_decision(
  File "~/alpha-beta-CROWN/complete_verifier/activation_split/decision_precompute.py", line 101, in compute_first_iteration_decision
    branching_decisions = branching_heuristic.compute_branching_decisions(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/alpha-beta-CROWN/complete_verifier/heuristics/nonlinear/bbps.py", line 136, in compute_branching_decisions
    layers, indices, points = self.get_heuristic_decisions(
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/alpha-beta-CROWN/complete_verifier/heuristics/nonlinear/bbps.py", line 91, in get_heuristic_decisions
    ret = self.compute_branching_scores(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/alpha-beta-CROWN/complete_verifier/heuristics/nonlinear/bbps.py", line 268, in compute_branching_scores
    return self.compute_scores_with_points(node, domains, points)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/alpha-beta-CROWN/complete_verifier/heuristics/nonlinear/bbps.py", line 310, in compute_scores_with_points
    return self._fast_heuristic(
           ^^^^^^^^^^^^^^^^^^^^^
  File "~/alpha-beta-CROWN/complete_verifier/heuristics/nonlinear/bbps.py", line 320, in _fast_heuristic
    A_before, bound_before, unstable_idx = self._fast_backward_propagation(
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/alpha-beta-CROWN/complete_verifier/heuristics/nonlinear/bbps.py", line 436, in _fast_backward_propagation
    A_saved = self.net.A_saved[node_pre.name][self.model.input_name[0]]
              ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
KeyError: '/299'

  1. The alpha-beta-CROWN repository was left unchanged.

System configuration:

  • OS: Red Hat Enterprise Linux (Rocky Linux 8.10 (Green Obsidian))
  • Python version: Python 3.11
  • Pytorch Version: PyTorch 2.11
  • Hardware: Tesla V100-PCIE-16GB and NVIDIA A100 80GB PCIe (experiments on two configs)
  • Have you tried to reproduce the problem in a cleanly created conda/virtualenv environment using official installation instructions and the latest code on the main branch?: Yes

Additional context
This issue happened on a model with almost the same architecture than the one of this issue. The only difference is the number of LSTMCells used in each model. It is highly likely that both issues can happen on both models depending on the specification file.
This also means that it is unlikely that the model is the sole issue, it seems to be the combination of a model with a specific specification file, as this step raised no issue in the other I posted on GitHub.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions