Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.
This repository was archived by the owner on Nov 28, 2025. It is now read-only.

Limitation on Spark "task_gpu_amount" cannot be less than 1 #204

@chenya-zhang

Description

@chenya-zhang

Hi folks, here is some context of the limitation we encountered.

  1. There is a check from "mirrored_strategy_runner.py" that "task_gpu_amount" cannot be less than 1.
    https://github.com/tensorflow/ecosystem/blob/master/spark/spark-tensorflow-distributor/spark_tensorflow_distributor/mirrored_strategy_runner.py#L161-L164
  2. "spark.task.resource.gpu.amount" can by default be set to a decimal amount per Nvidia's docs, https://www.nvidia.com/en-us/ai-data-science/spark-ebook/getting-started-spark-3/.
  3. There is an option in TensorFlow to set a fractional GPU amount to limit the memory usage: https://www.tensorflow.org/api_docs/python/tf/compat/v1/GPUOptions, Tensorflow v2 Limit GPU Memory usage tensorflow#25138

In this case, does it make sense for Spark TensorFlow distributer to allow the GPU per task to be less than 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