gcn3

package module
v1.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2020 License: MIT Imports: 21 Imported by: 0

README

MGPUSIM

Slack

Go Report Card Test Coverage

MGPUSim is a GPU simulator that models AMD GCN3 ISA based GPUs.

Documentation

Overview

Package gcn3 and its subpackages provides a emulator and a detailed timing simulator for GCN3-based AMD GPUs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CUPipelineFlushReq

type CUPipelineFlushReq struct {
	akita.MsgMeta
}

A CUPipelineFlushReq is a message from CP to ask the CU pipeline to flush

func (*CUPipelineFlushReq) Meta

func (m *CUPipelineFlushReq) Meta() *akita.MsgMeta

Meta returns the meta data associated with the message.

type CUPipelineFlushReqBuilder

type CUPipelineFlushReqBuilder struct {
	// contains filtered or unexported fields
}

CUPipelineFlushReqBuilder can build new CU flush reqs

func (CUPipelineFlushReqBuilder) Build

Build creats a new CUPipelineFlushReq

func (CUPipelineFlushReqBuilder) WithDst

WithDst sets the destination of the request to build.

func (CUPipelineFlushReqBuilder) WithSendTime

WithSendTime sets the send time of the request to build.:w

func (CUPipelineFlushReqBuilder) WithSrc

WithSrc sets the source of the request to build.

type CUPipelineFlushRsp

type CUPipelineFlushRsp struct {
	akita.MsgMeta
}

A CUPipelineFlushRsp is a message from CU to CP indicating flush is complete

func (*CUPipelineFlushRsp) Meta

func (m *CUPipelineFlushRsp) Meta() *akita.MsgMeta

Meta returns the meta data associated with the message.

type CUPipelineFlushRspBuilder

type CUPipelineFlushRspBuilder struct {
	// contains filtered or unexported fields
}

CUPipelineFlushRspBuilder can build new CU flush rsps

func (CUPipelineFlushRspBuilder) Build

Build creates a new CUPipelineFlushRsp

func (CUPipelineFlushRspBuilder) WithDst

WithDst sets the destination of the request to build.

func (CUPipelineFlushRspBuilder) WithSendTime

WithSendTime sets the send time of the request to build.:w

func (CUPipelineFlushRspBuilder) WithSrc

WithSrc sets the source of the request to build.

type CUPipelineRestartReq

type CUPipelineRestartReq struct {
	akita.MsgMeta
}

A CUPipelineRestartReq is a message from CP to ask the CU pipeline to resume after a flush/drain

func (*CUPipelineRestartReq) Meta

func (m *CUPipelineRestartReq) Meta() *akita.MsgMeta

Meta returns the meta data associated with the message.

type CUPipelineRestartReqBuilder

type CUPipelineRestartReqBuilder struct {
	// contains filtered or unexported fields
}

CUPipelineRestartReqBuilder can build new CU restart reqs

func (CUPipelineRestartReqBuilder) Build

Build creats a new CUPipelineRestartReq

func (CUPipelineRestartReqBuilder) WithDst

WithDst sets the destination of the request to build.

func (CUPipelineRestartReqBuilder) WithSendTime

WithSendTime sets the send time of the request to build.:w

func (CUPipelineRestartReqBuilder) WithSrc

WithSrc sets the source of the request to build.

type CUPipelineRestartRsp

type CUPipelineRestartRsp struct {
	akita.MsgMeta
}

A CUPipelineRestartRsp is a message from CU indicating the restart is complete

func (*CUPipelineRestartRsp) Meta

func (m *CUPipelineRestartRsp) Meta() *akita.MsgMeta

Meta returns the meta data associated with the message.

type CUPipelineRestartRspBuilder

type CUPipelineRestartRspBuilder struct {
	// contains filtered or unexported fields
}

CUPipelineRestartReqBuilder can build new CU restart reqs

func (CUPipelineRestartRspBuilder) Build

Build creats a new CUPipelineRestartRsp

func (CUPipelineRestartRspBuilder) WithDst

WithDst sets the destination of the request to build.

func (CUPipelineRestartRspBuilder) WithSendTime

WithSendTime sets the send time of the request to build.:w

func (CUPipelineRestartRspBuilder) WithSrc

WithSrc sets the source of the request to build.

type CommandProcessor

type CommandProcessor struct {
	*akita.TickingComponent

	Dispatcher         akita.Port
	DMAEngine          akita.Port
	Driver             akita.Port
	TLBs               []akita.Port
	CUs                []akita.Port
	AddressTranslators []akita.Port
	RDMA               akita.Port
	PMC                akita.Port
	L1VCaches          []akita.Port
	L1SCaches          []akita.Port
	L1ICaches          []akita.Port
	L2Caches           []akita.Port
	DRAMControllers    []*idealmemcontroller.Comp

	ToDriver akita.Port

	ToDispatcher akita.Port

	ToCUs akita.Port

	ToTLBs akita.Port

	ToAddressTranslators akita.Port

	ToCaches akita.Port

	ToRDMA akita.Port

	ToPMC akita.Port
	// contains filtered or unexported fields
}

CommandProcessor is an Akita component that is responsible for receiving requests from the driver and dispatch the requests to other parts of the GPU.

ToDriver <=> Receive request and send feedback to the driver
ToDispatcher <=> Dispatcher of compute kernels

func NewCommandProcessor

func NewCommandProcessor(name string, engine akita.Engine) *CommandProcessor

NewCommandProcessor creates a new CommandProcessor

func (*CommandProcessor) Handle

func (p *CommandProcessor) Handle(e akita.Event) error

Handle processes the events that is scheduled for the CommandProcessor

func (*CommandProcessor) Tick

func (p *CommandProcessor) Tick(now akita.VTimeInSec) bool

type DMAEngine

type DMAEngine struct {
	*akita.TickingComponent

	Log2AccessSize uint64

	ToCP  akita.Port
	ToMem akita.Port
	// contains filtered or unexported fields
}

A DMAEngine is responsible for accessing data that does not belongs to the GPU that the DMAEngine works in.

func NewDMAEngine

func NewDMAEngine(
	name string,
	engine akita.Engine,
	localDataSource cache.LowModuleFinder,
) *DMAEngine

NewDMAEngine creates a DMAEngine, injecting a engine and a "LowModuleFinder" that helps with locating the module that holds the data.

func (*DMAEngine) Tick

func (dma *DMAEngine) Tick(now akita.VTimeInSec) bool

type Dispatcher

type Dispatcher struct {
	*akita.TickingComponent

	CUs []akita.Port

	ShowProgressBar bool

	ToCUs              akita.Port
	ToCommandProcessor akita.Port
	// contains filtered or unexported fields
}

A Dispatcher is a component that can dispatch work-groups and wavefronts to ComputeUnits.

<=> ToCUs The connection that is connecting the dispatcher and the
    compute units

<=> ToCP The connection that is connecting the dispatcher
    with the command processor

The protocol that is defined by the dispatcher is as follows:

When the dispatcher receives a LaunchKernelReq request from the command processor, the kernel launching process is started. One dispatcher can only process one kernel at a time. So if the dispatcher is busy when the LaunchKernel is received, an NACK will be replied to the command processor.

During the kernel dispatching process, the dispatcher will first check if the next compute unit can map a workgroup or not by sending a MapWGReq. The selection of the compute unit is in a round-robin fashion. If the compute unit can map a work-group, the dispatcher will dispatch wavefronts onto the compute unit by sending DispatchWfReq. The dispatcher will wait for the compute unit to return completion message for the DispatchWfReq before dispatching the next wavefront.

Dispatcher receives

KernelDispatchReq ---- Request the dispatcher to dispatch the a kernel
                       to the compute units (Initialize)

MapWGReq ---- The request return from the compute unit tells if the
              compute unit is able to run the work-group (Receive(?))

WGFinishMesg ---- The CU send this message to the dispatcher to notify
                  the completion of a workgroup (Finalization(?))

func NewDispatcher

func NewDispatcher(
	name string,
	engine akita.Engine,
	gridBuilder kernels.GridBuilder,
) *Dispatcher

NewDispatcher creates a new dispatcher

func (*Dispatcher) RegisterCU

func (d *Dispatcher) RegisterCU(cu akita.Port)

RegisterCU adds a CU to the dispatcher so that the dispatcher can dispatches wavefronts to the CU

func (*Dispatcher) Tick

func (d *Dispatcher) Tick(now akita.VTimeInSec) bool

type FlushCommand

type FlushCommand struct {
	akita.MsgMeta
}

FlushCommand requests the GPU to flush all the cache to the main memory

func NewFlushCommand

func NewFlushCommand(time akita.VTimeInSec, src, dst akita.Port) *FlushCommand

NewFlushCommand Creates a new flush command, setting the request send time with time and the source and destination.

func (*FlushCommand) Meta

func (m *FlushCommand) Meta() *akita.MsgMeta

Meta returns the meta data associated with the message.

type GPU

type GPU struct {
	CommandProcessor   *CommandProcessor
	RDMAEngine         *rdma.Engine
	PMC                *pagemigrationcontroller.PageMigrationController
	Dispatchers        []akita.Component
	CUs                []akita.Component
	L1VCaches          []akita.Component
	L1ICaches          []akita.Component
	L1SCaches          []akita.Component
	L2Caches           []*writeback.Cache
	L2CacheFinder      cache.LowModuleFinder
	L2TLBs             []*tlb.TLB
	L1VTLBs            []*tlb.TLB
	L1STLBs            []*tlb.TLB
	L1ITLBs            []*tlb.TLB
	L1VAddrTranslator  []*addresstranslator.AddressTranslator
	L1IAddrTranslator  []*addresstranslator.AddressTranslator
	L1SAddrTranslator  []*addresstranslator.AddressTranslator
	MemoryControllers  []akita.Component
	Storage            *mem.Storage
	InternalConnection akita.Connection

	GPUID uint64
}

A GPU is a wrapper that holds all the subcomponent of a GPU.

func NewGPU

func NewGPU(name string) *GPU

NewGPU returns a newly created GPU

func (*GPU) ExternalPorts

func (g *GPU) ExternalPorts() []akita.Port

type GPURestartReq

type GPURestartReq struct {
	akita.MsgMeta

	StartTime akita.VTimeInSec
	EndTime   akita.VTimeInSec
}

GPURestartReq is a req to GPU to start the pipeline and unpause all paused components

func NewGPURestartReq

func NewGPURestartReq(
	time akita.VTimeInSec,
	src, dst akita.Port,
) *GPURestartReq

func (*GPURestartReq) Meta

func (m *GPURestartReq) Meta() *akita.MsgMeta

Meta returns the meta data associated with the message.

type GPURestartRsp

type GPURestartRsp struct {
	akita.MsgMeta

	StartTime akita.VTimeInSec
	EndTime   akita.VTimeInSec
}

GPURestartRsp is a rsp indicating the restart is complete

func NewGPURestartRsp

func NewGPURestartRsp(
	time akita.VTimeInSec,
	src, dst akita.Port,
) *GPURestartRsp

func (*GPURestartRsp) Meta

func (m *GPURestartRsp) Meta() *akita.MsgMeta

Meta returns the meta data associated with the message.

type LaunchKernelReq

type LaunchKernelReq struct {
	akita.MsgMeta

	PID ca.PID

	Packet        *kernels.HsaKernelDispatchPacket
	PacketAddress uint64
	HsaCo         *insts.HsaCo
	WGFilter      func(*LaunchKernelReq, *kernels.WorkGroup) bool
}

A LaunchKernelReq is a request that asks a GPU to launch a kernel

func NewLaunchKernelReq

func NewLaunchKernelReq(
	time akita.VTimeInSec,
	src, dst akita.Port) *LaunchKernelReq

NewLaunchKernelReq returns a new LaunchKernelReq

func (*LaunchKernelReq) Meta

func (m *LaunchKernelReq) Meta() *akita.MsgMeta

Meta returns the meta data associated with the message.

type MapWGReq

type MapWGReq struct {
	akita.MsgMeta

	WG               *kernels.WorkGroup
	PID              ca.PID
	Ok               bool
	CUOutOfResources bool
}

MapWGReq is a request that is send by the Dispatcher to a ComputeUnit to ask the ComputeUnit to reserve resources for the work-group

func NewMapWGReq

func NewMapWGReq(
	src, dst akita.Port,
	time akita.VTimeInSec,
	wg *kernels.WorkGroup,
) *MapWGReq

NewMapWGReq returns a newly created MapWGReq

func (*MapWGReq) Meta

func (m *MapWGReq) Meta() *akita.MsgMeta

Meta returns the meta data associated with the message.

type MemCopyD2HReq

type MemCopyD2HReq struct {
	akita.MsgMeta
	SrcAddress uint64
	DstBuffer  []byte
}

A MemCopyD2HReq is a request that asks the DMAEngine to copy memory from the host to the device

func NewMemCopyD2HReq

func NewMemCopyD2HReq(
	time akita.VTimeInSec,
	src, dst akita.Port,
	srcAddress uint64,
	dstBuffer []byte,
) *MemCopyD2HReq

NewMemCopyD2HReq created a new MemCopyH2DReq

func (*MemCopyD2HReq) Meta

func (m *MemCopyD2HReq) Meta() *akita.MsgMeta

Meta returns the meta data associated with the message.

type MemCopyH2DReq

type MemCopyH2DReq struct {
	akita.MsgMeta
	SrcBuffer  []byte
	DstAddress uint64
}

A MemCopyH2DReq is a request that asks the DMAEngine to copy memory from the host to the device

func NewMemCopyH2DReq

func NewMemCopyH2DReq(
	time akita.VTimeInSec,
	src, dst akita.Port,
	srcBuffer []byte,
	dstAddress uint64,
) *MemCopyH2DReq

NewMemCopyH2DReq created a new MemCopyH2DReq

func (*MemCopyH2DReq) Meta

func (m *MemCopyH2DReq) Meta() *akita.MsgMeta

Meta returns the meta data associated with the message.

type PageMigrationReqToCP

type PageMigrationReqToCP struct {
	akita.MsgMeta

	StartTime akita.VTimeInSec
	EndTime   akita.VTimeInSec

	ToReadFromPhysicalAddress uint64
	ToWriteToPhysicalAddress  uint64
	DestinationPMCPort        akita.Port
	PageSize                  uint64
}

PageMigrationReqToCP is a request to CP to start the page migration process

func NewPageMigrationReqToCP

func NewPageMigrationReqToCP(
	time akita.VTimeInSec,
	src, dst akita.Port,
) *PageMigrationReqToCP

func (*PageMigrationReqToCP) Meta

func (m *PageMigrationReqToCP) Meta() *akita.MsgMeta

Meta returns the meta data associated with the message.

type PageMigrationRspToDriver

type PageMigrationRspToDriver struct {
	akita.MsgMeta

	StartTime akita.VTimeInSec
	EndTime   akita.VTimeInSec
}

PageMigrationRspToDriver is a rsp to driver indicating completion of Page Migration requests

func NewPageMigrationRspToDriver

func NewPageMigrationRspToDriver(
	time akita.VTimeInSec,
	src, dst akita.Port,
) *PageMigrationRspToDriver

func (*PageMigrationRspToDriver) Meta

Meta returns the meta data associated with the message.

type RDMADrainCmdFromDriver

type RDMADrainCmdFromDriver struct {
	akita.MsgMeta

	StartTime akita.VTimeInSec
	EndTime   akita.VTimeInSec
}

RDMADrainCmd is driver asking CP to drain local RDMA

func NewRDMADrainCmdFromDriver

func NewRDMADrainCmdFromDriver(
	time akita.VTimeInSec,
	src, dst akita.Port,
) *RDMADrainCmdFromDriver

func (*RDMADrainCmdFromDriver) Meta

Meta returns the meta data associated with the message.

type RDMADrainRspToDriver

type RDMADrainRspToDriver struct {
	akita.MsgMeta

	StartTime akita.VTimeInSec
	EndTime   akita.VTimeInSec
}

RDMADrainCmd is a rsp to driver indicating completion of RDMA drain

func NewRDMADrainRspToDriver

func NewRDMADrainRspToDriver(
	time akita.VTimeInSec,
	src, dst akita.Port,
) *RDMADrainRspToDriver

func (*RDMADrainRspToDriver) Meta

func (m *RDMADrainRspToDriver) Meta() *akita.MsgMeta

Meta returns the meta data associated with the message.

type RDMARestartCmdFromDriver

type RDMARestartCmdFromDriver struct {
	akita.MsgMeta

	StartTime akita.VTimeInSec
	EndTime   akita.VTimeInSec
}

RDMARestartCmd is a cmd to unpause the RDMA

func NewRDMARestartCmdFromDriver

func NewRDMARestartCmdFromDriver(
	time akita.VTimeInSec,
	src, dst akita.Port,
) *RDMARestartCmdFromDriver

func (*RDMARestartCmdFromDriver) Meta

Meta returns the meta data associated with the message.

type RDMARestartRspToDriver

type RDMARestartRspToDriver struct {
	akita.MsgMeta

	StartTime akita.VTimeInSec
	EndTime   akita.VTimeInSec
}

func NewRDMARestartRspToDriver

func NewRDMARestartRspToDriver(
	time akita.VTimeInSec,
	src, dst akita.Port,
) *RDMARestartRspToDriver

func (*RDMARestartRspToDriver) Meta

Meta returns the meta data associated with the message.

type ReplyKernelCompletionEvent

type ReplyKernelCompletionEvent struct {
	*akita.EventBase
	Req *LaunchKernelReq
}

func NewReplyKernelCompletionEvent

func NewReplyKernelCompletionEvent(
	time akita.VTimeInSec,
	handler akita.Handler,
	req *LaunchKernelReq,
) *ReplyKernelCompletionEvent

type ShootDownCommand

type ShootDownCommand struct {
	akita.MsgMeta

	StartTime akita.VTimeInSec
	EndTime   akita.VTimeInSec

	VAddr []uint64
	PID   ca.PID
}

ShootDownCommand requests the GPU to perform a TLB shootdown and invalidate the corresponding PTE's

func NewShootdownCommand

func NewShootdownCommand(
	time akita.VTimeInSec,
	src, dst akita.Port,
	vAddr []uint64,
	pID ca.PID,
) *ShootDownCommand

NewShootdownCommand tells the CP to drain all CU and invalidate PTE's in TLB and Page Tables

func (*ShootDownCommand) Meta

func (m *ShootDownCommand) Meta() *akita.MsgMeta

Meta returns the meta data associated with the message.

type ShootDownCompleteRsp

type ShootDownCompleteRsp struct {
	akita.MsgMeta

	StartTime akita.VTimeInSec
	EndTime   akita.VTimeInSec
}

func NewShootdownCompleteRsp

func NewShootdownCompleteRsp(
	time akita.VTimeInSec,
	src, dst akita.Port,
) *ShootDownCompleteRsp

func (*ShootDownCompleteRsp) Meta

func (m *ShootDownCompleteRsp) Meta() *akita.MsgMeta

Meta returns the meta data associated with the message.

type WGFinishMesg

type WGFinishMesg struct {
	akita.MsgMeta

	WG *kernels.WorkGroup
}

A WGFinishMesg is sent by a compute unit to notify about the completion of a work-group

func NewWGFinishMesg

func NewWGFinishMesg(
	src, dst akita.Port,
	time akita.VTimeInSec,
	wg *kernels.WorkGroup,
) *WGFinishMesg

NewWGFinishMesg creates and returns a newly created WGFinishMesg

func (*WGFinishMesg) Meta

func (m *WGFinishMesg) Meta() *akita.MsgMeta

Meta returns the meta data associated with the message.

Directories

Path Synopsis
Package benchmarks defines Benchmark interface.
Package benchmarks defines Benchmark interface.
amdappsdk/bitonicsort
Code generated by go-bindata.
Code generated by go-bindata.
amdappsdk/fastwalshtransform
Package fastwalshtransform implements the fastwalshtransform benchmark from AMDAPPSDK.
Package fastwalshtransform implements the fastwalshtransform benchmark from AMDAPPSDK.
amdappsdk/floydwarshall
Package floydwarshall implements the Floyd-Warshall benchmark from AMDAPPSDK.
Package floydwarshall implements the Floyd-Warshall benchmark from AMDAPPSDK.
amdappsdk/matrixmultiplication
Package matrixmultiplication implements the matrix multiplication benchmark from AMDAPPSDK.
Package matrixmultiplication implements the matrix multiplication benchmark from AMDAPPSDK.
amdappsdk/matrixtranspose
Package matrixtranspose implements the matrix transpose benchmark from AMDAPPSDK.
Package matrixtranspose implements the matrix transpose benchmark from AMDAPPSDK.
amdappsdk/simpleconvolution
Code generated by go-bindata.
Code generated by go-bindata.
dnn/maxpooling
Package maxpooling implements the maxpooling algorithm as a benchmark.
Package maxpooling implements the maxpooling algorithm as a benchmark.
dnn/relu
Code generated by go-bindata.
Code generated by go-bindata.
heteromark/aes
Code generated by go-bindata.
Code generated by go-bindata.
heteromark/fir
Code generated by go-bindata.
Code generated by go-bindata.
heteromark/kmeans
Code generated by go-bindata.
Code generated by go-bindata.
heteromark/pagerank
Package pagerank implements the PageRank benchmark form Hetero-Mark.
Package pagerank implements the PageRank benchmark form Hetero-Mark.
polybench/atax
Package atax implements the ATAX benchmark from Polybench.
Package atax implements the ATAX benchmark from Polybench.
polybench/bicg
Package bicg implements the bicg benchmark from Polybench.
Package bicg implements the bicg benchmark from Polybench.
shoc/bfs
Package bfs implements the bfs benchmark from the SHOC suite.
Package bfs implements the bfs benchmark from the SHOC suite.
shoc/stencil2d
Package stencil2d implements the stencil2d benchmark from the SHOC suite.
Package stencil2d implements the stencil2d benchmark from the SHOC suite.
Package driver implements a GPU driver that interfaces the benchmarks with the simulator.
Package driver implements a GPU driver that interfaces the benchmarks with the simulator.
internal
Package internal provides support for the driver implementation.
Package internal provides support for the driver implementation.
Package emu emulates GCN3 instructions.
Package emu emulates GCN3 instructions.
Package gpubuilder provides default builders for commonly used GPUs.
Package gpubuilder provides default builders for commonly used GPUs.
Package insts provides the definition for GCN3 instructions.
Package insts provides the definition for GCN3 instructions.
Package kernels provides basic data definitions related to GPU kernels.
Package kernels provides basic data definitions related to GPU kernels.
Package pagemigrationcontroller provides an implementation of a PageMigrationController.
Package pagemigrationcontroller provides an implementation of a PageMigrationController.
Package platform provides default platform builders.
Package platform provides default platform builders.
Package rdma provides the implementation of an RDMA engine.
Package rdma provides the implementation of an RDMA engine.
samples
aes
bfs
fir
runner
Package runner defines how default benchmark samples are executed.
Package runner defines how default benchmark samples are executed.
tests
deterministic/runner
Package runner provides the implementation of the deterministic runner.
Package runner provides the implementation of the deterministic runner.
Package timing provides an implementation of detailed Compute Unit modeling.
Package timing provides an implementation of detailed Compute Unit modeling.
caches/l1v
Package l1v provides a GCN3 GPU L1 cache implementation.
Package l1v provides a GCN3 GPU L1 cache implementation.
mock_timing
Package mock_timing is a generated GoMock package.
Package mock_timing is a generated GoMock package.
pipelines
Package pipelines defines a pipeline timing model.
Package pipelines defines a pipeline timing model.
wavefront
Package wavefront defines concepts related to a wavefront.
Package wavefront defines concepts related to a wavefront.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL