Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 943D7200D0E for ; Tue, 12 Sep 2017 06:53:16 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 92C1C1609C6; Tue, 12 Sep 2017 04:53:16 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B9D231609C4 for ; Tue, 12 Sep 2017 06:53:15 +0200 (CEST) Received: (qmail 61447 invoked by uid 500); 12 Sep 2017 04:53:14 -0000 Mailing-List: contact yarn-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list yarn-issues@hadoop.apache.org Received: (qmail 61426 invoked by uid 99); 12 Sep 2017 04:53:14 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Sep 2017 04:53:14 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 17FD51A084C for ; Tue, 12 Sep 2017 04:53:14 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id xzHt0d7wG3q5 for ; Tue, 12 Sep 2017 04:53:12 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 7306661273 for ; Tue, 12 Sep 2017 04:53:09 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 1C191E0F14 for ; Tue, 12 Sep 2017 04:53:07 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 8C17124176 for ; Tue, 12 Sep 2017 04:53:03 +0000 (UTC) Date: Tue, 12 Sep 2017 04:53:03 +0000 (UTC) From: "Devaraj K (JIRA)" To: yarn-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (YARN-6620) [YARN-6223] NM Java side code changes to support isolate GPU devices by using CGroups MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 12 Sep 2017 04:53:16 -0000 [ https://issues.apache.org/jira/browse/YARN-6620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16162491#comment-16162491 ] Devaraj K commented on YARN-6620: --------------------------------- Thanks [~leftnoteasy] for the patch, Great work! There are some comments on the patch. 1. XML file reading in GpuDeviceInformationParser.java, can we use the existing libraries like javax.xml.bind.JAXBContext to unmarshall the XML document to a Java Object instead of reading tag by tag? 2. If you don't agree to use the existing libraries for reading xml file, 'in' stream may have to be closed after reading/parsing. {code:xml} InputStream in = IOUtils.toInputStream(sanitizeXmlInput(xmlStr), "UTF-8"); doc = builder.parse(in); {code} 3. Instead of hardcoding the BINARY_NAME, can it be included as part of DEFAULT_NM_GPU_PATH_TO_EXEC as a default value, so that it can be also becomes configurable if incase users want to change it. {code:xml} public static final String DEFAULT_NM_GPU_PATH_TO_EXEC = ""; protected static final String BINARY_NAME = "nvidia-smi"; {code} 4. Please change the inline comment here accordingly. {code:xml} + /** + * Disk as a resource is disabled by default. + **/ + @Private + public static final boolean DEFAULT_NM_GPU_RESOURCE_ENABLED = false; {code} 5. Can we use spaces instead of tab characters for indentation in nvidia-smi-sample-output.xml? 6. Are we going to support multiple containers/processes(limited number) sharing the same GPU device? 7. {code:title=GpuResourceAllocator.java|borderStyle=solid} for (int deviceNum : allowedGpuDevices) { if (!usedDevices.containsKey(deviceNum)) { usedDevices.put(deviceNum, containerId); assignedGpus.add(deviceNum); if (assignedGpus.size() == numRequestedGpuDevices) { break; } } } // Record in state store if we allocated anything if (!assignedGpus.isEmpty()) { List allocatedDevices = new ArrayList<>(); for (int gpu : assignedGpus) { allocatedDevices.add(String.valueOf(gpu)); } {code} Can you merge these two for loops into a one like below, {code:xml} usedDevices.put(deviceNum, containerId); assignedGpus.add(deviceNum); allocatedDevices.add(String.valueOf(deviceNum)); {code} And also if the condition *if (assignedGpus.size() == numRequestedGpuDevices)* doesn't meet, do we need to throw an exception or log the error? 8. I see that getGpuDeviceInformation() is getting invoked twice which intern executes shell command and parses the xml file which are costly operations. Do we need to execute it twice here? {code:title=GpuResourceDiscoverPlugin.java|borderStyle=solid} GpuDeviceInformation info = getGpuDeviceInformation(); LOG.info("Trying to discover GPU information ..."); GpuDeviceInformation info = getGpuDeviceInformation(); {code} And also I don't convince that having the logic other than assigning conf in setConf() method. {code:xml} public synchronized void setConf(Configuration conf) { this.conf = conf; numOfErrorExecutionSinceLastSucceed = 0; featureEnabled = conf.getBoolean(YarnConfiguration.NM_GPU_RESOURCE_ENABLED, YarnConfiguration.DEFAULT_NM_GPU_RESOURCE_ENABLED); if (featureEnabled) { String dir = conf.get(YarnConfiguration.NM_GPU_PATH_TO_EXEC, ......... {code} And also there are Hadoop QA reported comments which needs to be fixed. > [YARN-6223] NM Java side code changes to support isolate GPU devices by using CGroups > ------------------------------------------------------------------------------------- > > Key: YARN-6620 > URL: https://issues.apache.org/jira/browse/YARN-6620 > Project: Hadoop YARN > Issue Type: Sub-task > Reporter: Wangda Tan > Assignee: Wangda Tan > Attachments: YARN-6620.001.patch, YARN-6620.002.patch, YARN-6620.003.patch, YARN-6620.004.patch, YARN-6620.005.patch > > > This JIRA plan to add support of: > 1) GPU configuration for NodeManagers > 2) Isolation in CGroups. (Java side). > 3) NM restart and recovery allocated GPU devices -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: yarn-issues-help@hadoop.apache.org