[Skiboot] [PATCH 7/7] Add Swift platform

Reza Arbab arbab at linux.ibm.com
Tue Jul 2 04:28:07 AEST 2019


On Wed, Jun 26, 2019 at 04:38:10PM +1000, Alexey Kardashevskiy wrote:
>On 13/06/2019 07:08, Reza Arbab wrote:
>> +/* Add GPU interconnect properties to the dt */
>> +static void swift_npu3_fixup(void)
>> +{
>> +	struct npu3 *npu;
>> +	struct npu3_dev *dev;
>> +	struct npu3_dev *devs[4] = {};
>
>So there are 4 interconnected GPUs per cluster now? Please define this 4
>as a macro. And...

Right. All four GPUs are interconnected now. This is different from 
Witherspoon, where GPUs are only interconnected to other GPUs from the 
same chip.

I'll use a macro to make it more clear what the 4 represents.

>> +	uint32_t index;
>> +
>> +	if (nr_chips() != 2 || npu3_chip_possible_gpus() != 2) {
>> +		prlog(PR_ERR, "NPU: Unknown link topology detected\n");
>> +		return;
>> +	}
>> +
>> +	/* Collect the first link we find for each GPU */
>> +	npu3_for_each_nvlink_npu(npu) {
>> +		npu3_for_each_nvlink_dev(dev, npu) {
>> +			index = npu3_dev_gpu_index(dev);
>> +			if (index == -1 || index >= ARRAY_SIZE(devs))
>> +				continue;
>> +
>> +			if (dev->nvlink.gpu && !devs[index])
>> +				devs[index] = dev;
>> +		}
>> +	}
>> +
>> +	add_peers_prop(0, G(3), G(3),
>> +			  G(2), G(2), G(2),
>> +			  G(1), G(1), G(1),
>> +			  N(0), N(0), N(0), N(0));
>
>
>... also 12 links per a GPU? Just curiosity. Thanks,

Yes. Each NPU has 12 links, and each GPU has 12 links.

>> +
>> +	add_peers_prop(1, G(2),
>> +			  G(3), G(3), G(3),
>> +			  G(0), G(0), G(0),
>> +			  G(2),
>> +			  N(1), N(1), N(1), N(1));
>> +
>> +	add_peers_prop(2, G(1),
>> +			  G(3), G(3), G(3),
>> +			  G(0), G(0), G(0),
>> +			  G(1),
>> +			  N(2), N(2), N(2), N(2));
>> +
>> +	add_peers_prop(3, G(2), G(2), G(2),
>> +			  G(1), G(1), G(1),
>> +			  G(0), G(0),
>> +			  N(3), N(3), N(3), N(3));
>> +}


-- 
Reza Arbab



More information about the Skiboot mailing list