gem5-dev@gem5.org

The gem5 Developer List

View all threads

[M] Change in gem5/gem5[develop]: misc: [WIP] ADD Vega GPU-FS tests

BB
Bobby Bruce (Gerrit)
Tue, May 9, 2023 10:40 PM

Bobby Bruce has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/70421?usp=email )

Change subject: misc: [WIP] ADD Vega GPU-FS tests
......................................................................

misc: [WIP] ADD Vega GPU-FS tests

Change-Id: I277815026a5cd4d8717434b54294d1682ef12b9d

M configs/example/gpufs/vega10_kvm.py
A tests/gem5/gpu/test_gpu_fs.py
2 files changed, 76 insertions(+), 1 deletion(-)

diff --git a/configs/example/gpufs/vega10_kvm.py
b/configs/example/gpufs/vega10_kvm.py
index 11f9fe2..53f6b58 100644
--- a/configs/example/gpufs/vega10_kvm.py
+++ b/configs/example/gpufs/vega10_kvm.py
@@ -35,6 +35,8 @@
import sys
import os

+from gem5.resources.resource import obtain_resource
+
from amd import AmdGPUOptions
from common import Options
from common import GPUTLBOptions
@@ -84,6 +86,13 @@
parser.add_argument(
"-o", "--opts", default="", help="GPU application arguments"
)

  • parser.add_argument(

  •    "--using-gem5-resources",
    
  •    action="store_true",
    
  •    default=False,
    
  •    help="If set, the app, kernel, disk image, and mmio are IDs which "
    
  •    "correspond to gem5-resources. To download and use.",
    
  • )

    if name == "m5_main":
    @@ -112,10 +121,20 @@
    elif args.gpu_mmio_trace is None:
    print(f"No MMIO trace path. Use {sys.argv[0]} --gpu-mmio-trace
    <path>")
    sys.exit(1)

  • elif not os.path.isfile(args.app):
  • elif not os.path.isfile(args.app) and not args.using_gem5_resources:
    print("Could not find applcation", args.app)
    sys.exit(1)

  • Here we do some conversion from the gem5-resources IDs to the local,

  • downloaded resource.

  • if args.using_gem5_resources:

  •    args.app = obtain_resource(args.app).get_local_path()
    
  •    args.kernel = obtain_resource(args.kernel).get_local_path()
    
  •    args.disk_image = obtain_resource(args.disk_image).get_local_path()
    
  •    args.gpu_mmio_trace = obtain_resource(
    
  •        args.gpu_mmio_trace
    
  •    ).get_local_path()
    
  • # Choose runscript Based on whether any checkpointing args are set
    if args.checkpoint_dir is not None:
        demo_runscript = demo_runscript_with_checkpoint
    

diff --git a/tests/gem5/gpu/test_gpu_fs.py b/tests/gem5/gpu/test_gpu_fs.py
new file mode 100644
index 0000000..d49492a
--- /dev/null
+++ b/tests/gem5/gpu/test_gpu_fs.py
@@ -0,0 +1,56 @@
+# Copyright (c) 2023 The Regents of the University of California
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from testlib import *
+
+"""
+"""
+
+gem5_verify_config(

  • name="test-gpu-fs-square",
  • verifiers=(),
  • fixtures=(),
  • config=joinpath(
  •    config.base_dir, "configs", "example", "gpufs", "vega10_kvm.py"
    
  • ),
  • config_args=[
  •    "--using-gem5-resources",
    
  •    "--app",
    
  •    "x86-gpu-square",
    
  •    "--kernel",
    
  •    "x86-linux-kernel-5.4.0-105-generic",
    
  •    "--disk-image",
    
  •    "x86-gpu-fs-img",
    
  •    "--gpu-mmio-trace",
    
  •    "vega-mmio",
    
  •    # TODO: There probably should be a way to specify where the  
    

resources

  •    # are downloaded to.
    
  • ],
  • valid_isas=(constants.vega_x86_tag,),
  • valid_hosts=(constants.host_x86_64_tag,),
  • length=constants.very_long_tag,
  • uses_kvm=True,
    +)

--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/70421?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I277815026a5cd4d8717434b54294d1682ef12b9d
Gerrit-Change-Number: 70421
Gerrit-PatchSet: 1
Gerrit-Owner: Bobby Bruce bbruce@ucdavis.edu

Bobby Bruce has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/70421?usp=email ) Change subject: misc: [WIP] ADD Vega GPU-FS tests ...................................................................... misc: [WIP] ADD Vega GPU-FS tests Change-Id: I277815026a5cd4d8717434b54294d1682ef12b9d --- M configs/example/gpufs/vega10_kvm.py A tests/gem5/gpu/test_gpu_fs.py 2 files changed, 76 insertions(+), 1 deletion(-) diff --git a/configs/example/gpufs/vega10_kvm.py b/configs/example/gpufs/vega10_kvm.py index 11f9fe2..53f6b58 100644 --- a/configs/example/gpufs/vega10_kvm.py +++ b/configs/example/gpufs/vega10_kvm.py @@ -35,6 +35,8 @@ import sys import os +from gem5.resources.resource import obtain_resource + from amd import AmdGPUOptions from common import Options from common import GPUTLBOptions @@ -84,6 +86,13 @@ parser.add_argument( "-o", "--opts", default="", help="GPU application arguments" ) + parser.add_argument( + "--using-gem5-resources", + action="store_true", + default=False, + help="If set, the app, kernel, disk image, and mmio are IDs which " + "correspond to gem5-resources. To download and use.", + ) if __name__ == "__m5_main__": @@ -112,10 +121,20 @@ elif args.gpu_mmio_trace is None: print(f"No MMIO trace path. Use {sys.argv[0]} --gpu-mmio-trace <path>") sys.exit(1) - elif not os.path.isfile(args.app): + elif not os.path.isfile(args.app) and not args.using_gem5_resources: print("Could not find applcation", args.app) sys.exit(1) + # Here we do some conversion from the gem5-resources IDs to the local, + # downloaded resource. + if args.using_gem5_resources: + args.app = obtain_resource(args.app).get_local_path() + args.kernel = obtain_resource(args.kernel).get_local_path() + args.disk_image = obtain_resource(args.disk_image).get_local_path() + args.gpu_mmio_trace = obtain_resource( + args.gpu_mmio_trace + ).get_local_path() + # Choose runscript Based on whether any checkpointing args are set if args.checkpoint_dir is not None: demo_runscript = demo_runscript_with_checkpoint diff --git a/tests/gem5/gpu/test_gpu_fs.py b/tests/gem5/gpu/test_gpu_fs.py new file mode 100644 index 0000000..d49492a --- /dev/null +++ b/tests/gem5/gpu/test_gpu_fs.py @@ -0,0 +1,56 @@ +# Copyright (c) 2023 The Regents of the University of California +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer; +# redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution; +# neither the name of the copyright holders nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +from testlib import * + +""" +""" + +gem5_verify_config( + name="test-gpu-fs-square", + verifiers=(), + fixtures=(), + config=joinpath( + config.base_dir, "configs", "example", "gpufs", "vega10_kvm.py" + ), + config_args=[ + "--using-gem5-resources", + "--app", + "x86-gpu-square", + "--kernel", + "x86-linux-kernel-5.4.0-105-generic", + "--disk-image", + "x86-gpu-fs-img", + "--gpu-mmio-trace", + "vega-mmio", + # TODO: There probably should be a way to specify where the resources + # are downloaded to. + ], + valid_isas=(constants.vega_x86_tag,), + valid_hosts=(constants.host_x86_64_tag,), + length=constants.very_long_tag, + uses_kvm=True, +) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/70421?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I277815026a5cd4d8717434b54294d1682ef12b9d Gerrit-Change-Number: 70421 Gerrit-PatchSet: 1 Gerrit-Owner: Bobby Bruce <bbruce@ucdavis.edu>