That's a good point, Stephan. It makes total sense to generalize the resource management to support custom resources. Having that allows users to add new resources by themselves. The general resource management may involve two different aspects:
1. The custom resource type definition. It is supported by the extended resources in ResourceProfile and ResourceSpec. This will likely cover majority of the cases. 2. The custom resource allocation logic, i.e. how to assign the resources to different tasks, operators, and so on. This may require two levels / steps: a. Subtask level - make sure the subtasks are put into suitable slots. It is done by the global RM and is not customizable right now. b. Operator level - map the exact resource to the operators in TM. e.g. GPU 1 for operator A, GPU 2 for operator B. This step is needed assuming the global RM does not distinguish individual resources of the same type. It is true for memory, but not for GPU. The GPU manager is designed to do 2.b here. So it should discover the physical GPU information and bind/match them to each operators. Making this general will fill in the missing piece to support custom resource type definition. But I'd avoid calling it a "External Resource Manager" to avoid confusion with RM, maybe something like "Operator Resource Assigner" would be more accurate. So for each resource type users can have an optional "Operator Resource Assigner" in the TM. For memory, users don't need this, but for other extended resources, users may need that. Personally I think a pluggable "Operator Resource Assigner" is achievable in this FLIP. But I am also OK with having that in a separate FLIP because the interface between the "Operator Resource Assigner" and operator may take a while to settle down if we want to make it generic. But I think our implementation should take this future work into consideration so that we don't need to break backwards compatibility once we have that. Thanks, Jiangjie (Becket) Qin On Wed, Mar 4, 2020 at 12:27 AM Stephan Ewen <se...@apache.org> wrote: > Thank you for writing this FLIP. > > I cannot really give much input into the mechanics of GPU-aware scheduling > and GPU allocation, as I have no experience with that. > > One thought I had when reading the proposal is if it makes sense to look at > the "GPU Manager" as an "External Resource Manager", and GPU is one such > resource. > The way I understand the ResourceProfile and ResourceSpec, that is how it > is done there. > It has the advantage that it looks more extensible. Maybe there is a GPU > Resource, a specialized NVIDIA GPU Resource, and FPGA Resource, a Alibaba > TPU Resource, etc. > > Best, > Stephan > > > On Tue, Mar 3, 2020 at 7:57 AM Becket Qin <becket....@gmail.com> wrote: > > > Thanks for the FLIP Yangze. GPU resource management support is a > must-have > > for machine learning use cases. Actually it is one of the mostly asked > > question from the users who are interested in using Flink for ML. > > > > Some quick comments / questions to the wiki. > > 1. The WebUI / REST API should probably also be mentioned in the public > > interface section. > > 2. Is the data structure that holds GPU info also a public API? > > > > Thanks, > > > > Jiangjie (Becket) Qin > > > > On Tue, Mar 3, 2020 at 10:15 AM Xintong Song <tonysong...@gmail.com> > > wrote: > > > > > Thanks for drafting the FLIP and kicking off the discussion, Yangze. > > > > > > Big +1 for this feature. Supporting using of GPU in Flink is > significant, > > > especially for the ML scenarios. > > > I've reviewed the FLIP wiki doc and it looks good to me. I think it's a > > > very good first step for Flink's GPU supports. > > > > > > Thank you~ > > > > > > Xintong Song > > > > > > > > > > > > On Mon, Mar 2, 2020 at 12:06 PM Yangze Guo <karma...@gmail.com> wrote: > > > > > > > Hi everyone, > > > > > > > > We would like to start a discussion thread on "FLIP-108: Add GPU > > > > support in Flink"[1]. > > > > > > > > This FLIP mainly discusses the following issues: > > > > > > > > - Enable user to configure how many GPUs in a task executor and > > > > forward such requirements to the external resource managers (for > > > > Kubernetes/Yarn/Mesos setups). > > > > - Provide information of available GPU resources to operators. > > > > > > > > Key changes proposed in the FLIP are as follows: > > > > > > > > - Forward GPU resource requirements to Yarn/Kubernetes. > > > > - Introduce GPUManager as one of the task manager services to > discover > > > > and expose GPU resource information to the context of functions. > > > > - Introduce the default script for GPU discovery, in which we provide > > > > the privilege mode to help user to achieve worker-level isolation in > > > > standalone mode. > > > > > > > > Please find more details in the FLIP wiki document [1]. Looking > forward > > > to > > > > your feedbacks. > > > > > > > > [1] > > > > > > > > > > https://cwiki.apache.org/confluence/display/FLINK/FLIP-108%3A+Add+GPU+support+in+Flink > > > > > > > > Best, > > > > Yangze Guo > > > > > > > > > >