Skip to content

Consistent use of torch device in ‎HitAndRunPolytopeSampler #2500

@mhrmsn

Description

@mhrmsn

Issue description

In botorch.utils.sampling.‎HitAndRunPolytopeSampler.draw (see here), when calling sample_polytope, the tensors A and b are explictly moved to the CPU, but not x0.

Is this intended, and if so why? If not, should this be changed to moving x0 also explicitly to the CPU or by taking the source devices of all tensors?

x0 seems to ultimately come from the equality constraints (x0 -> self.nullC -> Vh -> self.C -> equality_constraints). Depending on where the equality constraints come from (external library that calls botorch) this might be an issue, and given that those tensors must anyway be on the same device for multiplication in sample_polytope, it might make sense to change this.

System Info

Please provide information about your setup, including

  • BoTorch Version (0.11.3)
  • GPyTorch Version (1.12)
  • PyTorch Version (2.3.0)
  • macOS Sonoma, 14.6.1

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