def set_ipu_model_options(opts, compile_ipu_code=True):
  """Set the IPU Model options.

  Args:
    compile_ipu_code: Whether or not to actually compile real IPU code for
      modelling.

  Returns:
    The IpuOptions configuration protobuf, with IPU model options set.
  """
  opts.ipu_model_config.compile_ipu_code = compile_ipu_code

  return opts