From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id DC192158095 for ; Mon, 5 Sep 2022 14:16:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 10AEEE0870; Mon, 5 Sep 2022 14:16:37 +0000 (UTC) Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 066D8E0870 for ; Mon, 5 Sep 2022 14:16:37 +0000 (UTC) Received: by mail-pg1-x52b.google.com with SMTP id c24so8196354pgg.11 for ; Mon, 05 Sep 2022 07:16:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:content-disposition:mime-version :message-id:subject:to:from:date:from:to:cc:subject:date; bh=O1QbeepaA2rjuII007oZlmELLaKLWMcaWvg7L4dPbzc=; b=A2YCxbJFOuPwngYQbdlmx6ToSZ2R67vzkGh3Hwr6Pfpt52q6fmw/oI34TaZQILw6jE 1e6k9/hhd4vdwY9jOf6nsDc/Ov+M+lBEiWsG/h8kA484Yyv41WUNlOZmWlP6Ib/pAHU9 YZhV74l11CHYLpRVmzr5mABwf5FSBUDgOMedq3N7Xy64eqnM68/R2IP4PyRmbvrQvK7U aAsMlpJtFpK+egrTNYpGVR8hs9SN0v5rwBseUEAiD5iqz82U3rMuwz/Px7WijEvtolBG ClohxEf2UX4i/X131uxex06LL2UqD7hb/Flhfa7haYh3/Ipy9cFV2f1BVE5oHivAg14t 3iMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-disposition:mime-version :message-id:subject:to:from:date:x-gm-message-state:from:to:cc :subject:date; bh=O1QbeepaA2rjuII007oZlmELLaKLWMcaWvg7L4dPbzc=; b=5F0r7jBG1EuZlpkWIVGaIXmrjxJ6dxmDO0/hC96VuPvWjLsuGqWUh9vTRkvqKncTIh FhiXr8fCgcZIuPQ1Qb+jRz7WUKU/mrlVjJ46NygRmPqENAJc/quY2zXpm26gUQW0ahvM 0COpzdc4m+FtEQ0BWx9Oeelf7smnaZOMtsj2gipZ2nUzQGhgWv9Vqu5T77G9NEfylCF6 dYWLQE07RtjaBckPtM4QOteRpuQ3EKvIdemCpoEP8eZvm1vRm65ziVxp5IhhnL/+FVkx 77x6K+LEry125Hpea6mB7FH49LJV8k7EoQyey8Z0pRZyAVwpsXtIKk1EexSu2JNBQech H7sA== X-Gm-Message-State: ACgBeo340TWFeXm9M39gDg3EwoTnEBoZpefjBkOicxwT8eukKqlTXG9R a8AdKIIHlXDYVcSQTqIgWDhRmTYXrGqDnZIO X-Google-Smtp-Source: AA6agR5GeUIuNNCQ1T3HHjPgH9kKurFiNQn4pbn4NmqB7PoKbOfVb0t55XZ2Ej5jO0XVpE6tgFVwKw== X-Received: by 2002:a05:6a00:88a:b0:53a:b7a0:ea3a with SMTP id q10-20020a056a00088a00b0053ab7a0ea3amr27406720pfj.21.1662387396170; Mon, 05 Sep 2022 07:16:36 -0700 (PDT) Received: from localhost (49.212.183.201.v6.sakura.ne.jp. [2403:3a00:202:1120:49:212:183:201]) by smtp.gmail.com with ESMTPSA id m14-20020a17090a4d8e00b002002fb120d7sm4017093pjh.8.2022.09.05.07.16.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 07:16:35 -0700 (PDT) Date: Mon, 5 Sep 2022 22:16:33 +0800 From: wuyy To: gentoo-soc Subject: [gentoo-soc] Week 12 Report for Refining ROCm Packages in Gentoo Message-ID: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-soc@lists.gentoo.org Reply-to: gentoo-soc@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Archives-Salt: 461dbfbe-2c39-404f-8d1b-92e9baeb0552 X-Archives-Hash: 3c73eb00cd7a3cb2485ad423b1c21833 Hello all, Although this is the final week, I would like to say that it is as exciting as the first week. I kept polishing rocm.eclass with the help of MichaƂ and my mentor, and it is now in good shape [1]. I must admit that the time to write an eclass for a beginner like me is much more than what I expected. In my proposal, I leave 4 weeks to finish it, 2-week implementation and 2-week polishing. In reality, I implemented within 2 weeks, but polished it for 4 weeks. I made a lot of QA issues and was not aware, which increases the number of review-modify cycles. During this process, I leant a lot: 1. Always re-read the eclass, especially comments and examples thoroughly after modification. Many times I forgot there is an example far from the change that should be updated because one functions changes its behavior. 2. Read the bash manual carefully, because properly usage of features like bash array can greatly simplify code. 3. Consider the maintenance difficulty of the eclass. I wrote a oddly specific `src_test`, which can cover all the cases of ROCm packages. But it's not worth it, because specialized code should be placed into ebuilds, not one eclass. So instead, I remain the most common part, `check_amdgpu`, and get rid of phase functions, which made the eclass much cleaner. I also find some bugs and their solutions. As I mentioned in week 10's report, I observed many test failures in sci-libs/miopen based on vanilla clang. In this week, I figured out that they have 3 different reasons, and I've provided the two fixes for two failures ([2, 3]). The third issue, I've found it's root cause [4]. I believe there would be a simple solution to this. For gcc-12 issues, I also come to a brutal workaround [5]: undef the __noinline__ macro before including stdc++ headers and def it afterwards. I also observed that clang-15 does not fix this issue as expected, and provided a MWE at [6]. I'm also writing wiki pages, filling installation and developing guide. In this 12-week project, I proposed to deliver rocm.eclass, and packages like pytorch, tensorflow with rocm enabled. Instead, I delivered rocm.eclass as proposed, but migrated the ROCm toolchain to vanilla clang. I thought porting ROCm toolchain to vanilla clang is closer to my project title "Refining ROCm Packages" :-) [1] https://github.com/gentoo/gentoo/pull/26784 [2] https://github.com/littlewu2508/gentoo/commit/2bfae2e26a23d78b634a87ef4a0b3f0cc242dbc4 [3] https://github.com/littlewu2508/gentoo/commit/cd11b542aec825338ec396bce5c63bbced534e27 [4] https://github.com/ROCmSoftwarePlatform/MIOpen/issues/1731 [5] https://github.com/littlewu2508/gentoo/commit/2a49b4db336b075f2ac1fdfbc907f828105ea7e1 [6] https://github.com/llvm/llvm-project/issues/57544 -- Yiyang Wu