--
You received this message because you are subscribed to the Google Groups "BOSP Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bosp-devel+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Patrick,
I’ve just sent you a SDK which reports the power consumption in the PIL. For that I extended the PIL with these new fields:
typedef struct PlatformDescriptor {
// Total energy in nJ consumed since the bootstrap
uint64_t totalEnergy;
// Last time in us the power values were updated
int64_t timestamp;
// The fabric side will put this field to 1 when a new value is available
// It should be set to 0 by host side when the value has been read
int32_t fabricUpdate;
// The host side should put this value to 1 once it is ready to read
// a new value. The fabric will never put a new value while this field
// is at 0. Once the power value is updated, the fabric set this field to
// to 0
int32_t hostReady;
Is it close to what you have already implemented ? In any case, if it is too far , I can change the interface. Did you push your modified PIL somewhere ?
Here the test sample code I’ve used to validate this extension:
int64_t lastTimestamp = 0;
int i;
for (i=0; i<10; i++) {
page->pdesc.hostReady = 1;
while(!page->pdesc.fabricUpdate);
page->pdesc.fabricUpdate = 0;
printf("Read new value energy=%lldnJ time %lldus power=%fmW\n", page->pdesc.totalEnergy, page->pdesc.timestamp - lastTimestamp, (float)(page->pdesc.totalEnergy)/(page->pdesc.timestamp - lastTimestamp));
lastTimestamp = page->pdesc.timestamp;
}
Normally this protocol should make sure that you don’t miss any value update and also that we don’t have any race condition between the host and the fabric sides. If you see any potential issue, let me know.
In case this interface is fine, could you try it on your side before Jens try it on SVC ?
Ciao,
Germain
--
Hi Patrick,
I’ve just sent you a SDK which reports the power consumption in the PIL. For that I extended the PIL with these new fields:
typedef struct PlatformDescriptor {
// Total energy in nJ consumed since the bootstrap
uint64_t totalEnergy;
// Last time in us the power values were updated
int64_t timestamp;
// The fabric side will put this field to 1 when a new value is available
// It should be set to 0 by host side when the value has been read
int32_t fabricUpdate;
// The host side should put this value to 1 once it is ready to read
// a new value. The fabric will never put a new value while this field
// is at 0. Once the power value is updated, the fabric set this field to
// to 0
int32_t hostReady;
Do we really need fabricUpdate and hostReady?I mean... for instance, from the BBQ side, we could read a sample of power consumption every 100ms, while from the STHORM side the value is updated every 10ms. Therefore we would have 10 updates from STHORM in the "BBQ period" of 100ms.My question is... do we expect not negligible variations in these 10 values?If the answer is YES: Ok, it is worth to consider the synchronization protocol above.
Conversely, if the answer is NO, from the BBQ side, it could be sufficient just to check that the value updated by the STHORM run-time is updated (timestamp changed?),, and thus get the power consumption value.The other point is... we expect to execute the power management policy with a granularity of seconds. Considering also the previous question, is this good enough for an effective power management of STHORM?
Hi Patrick,
indeed I’ve put this protocol to avoid 2 issues:
- The 64 bits types. BBQ could read 32bits of the old value and 32 bits of the new
- I can’t atomically update the power and the timestamp, thus it is possible to have a race condition on this and BBQ could for example read the previous value or miss a value.
Thus I think it is safer to keep this protocol, it will avoid strange behavior.
For what concerns the power vs energy, note that as you have the timestamp, you can convert from power to energy considering the timestamp of the previous measure.
Ciao,
Germain
Hi Patrick,
indeed I’ve put this protocol to avoid 2 issues:
- The 64 bits types. BBQ could read 32bits of the old value and 32 bits of the new
- I can’t atomically update the power and the timestamp, thus it is possible to have a race condition on this and BBQ could for example read the previous value or miss a value.
Thus I think it is safer to keep this protocol, it will avoid strange behavior.
For what concerns the power vs energy, note that as you have the timestamp, you can convert from power to energy considering the timestamp of the previous measure.
Ciao,
Germain
From: Patrick Bellasi [mailto:derk...@gmail.com]
Sent: Tuesday, April 09, 2013 5:48 PM
To: Germain HAUGOU
Cc: bosp-...@googlegroups.com
Subject: Re: SThorm Power Budget Control - Mechanisms & Policy
On Tue, Apr 9, 2013 at 5:18 PM, Germain HAUGOU <germain...@st.com> wrote:
Hi Patrick,
indeed I’ve put this protocol to avoid 2 issues:
- The 64 bits types. BBQ could read 32bits of the old value and 32 bits of the new
I can see just a single entry "totalEnergy" in the struct you use.
What do you mean by old and new value?
I mean the fabric will first issue a 32bits write to the LSB and then a second 32 bits write to the MSB. Between these 2 writes, BBQ could read the 32bits LSB of the new value which is being updated and the 32bits MSB of the old value being replaced. I must agree the probability is really low !
- I can’t atomically update the power and the timestamp, thus it is possible to have a race condition on this and BBQ could for example read the previous value or miss a value.
Right, but you could update the timestamp only after the new energy value has been updated, while BBQ check first the timestamp and only after a modification has been noticed read the energy value.
That way there should not be no race conditions, eventually just the risk to loss some samples...
This is what I mean, due to the non-atomic update, you can miss the previous or the current power value.
Thus I think it is safer to keep this protocol, it will avoid strange behavior.
However, just to have a fast convergence for the use-case, lets go for the solution you suggested.
We will implement the readings from the new PIL as soon as possible.
For what concerns the power vs energy, note that as you have the timestamp, you can convert from power to energy considering the timestamp of the previous measure.
Ok, sure. Indeed having an energy reading is for sure more accurate than reading a spot Power.
By the way, with Edoardo we are testing better the fabric_quota assignment code.
It seems there are some problems, probably the OCL code is running in just one of the 4 cluster, even if 4 WG are enqueued at the same time...
I remember that when we had a look, multiview was issuing come commands with only 1 work-group even when configured with 4 work-groups. Are you sure this is not the same issue ?
Moreover, checking the PIL data at run-time it seems that they are not properly configured, we are still investigating if it's a BBQ-side or fabric-side issue. We will report it back to you as soon as we have some more clue.
Ciao,
Germain
Ciao Patrick
By the way, with Edoardo we are testing better the fabric_quota assignment code.
It seems there are some problems, probably the OCL code is running in just one of the 4 cluster, even if 4 WG are enqueued at the same time...
I remember that when we had a look, multiview was issuing come commands with only 1 work-group even when configured with 4 work-groups. Are you sure this is not the same issue ?
Could you send me a binary package containing MV + BBQ that I can use to reproduce the issue ?
Ciao,
Germain
From: Patrick Bellasi [mailto:derk...@gmail.com]
Sent: Tuesday, April 09, 2013 7:31 PM
To: Germain HAUGOU
Cc: bosp-...@googlegroups.com
Subject: Re: SThorm Power Budget Control - Mechanisms & Policy
On Tue, Apr 9, 2013 at 7:01 PM, Germain HAUGOU <germain...@st.com> wrote:
Could you send me a binary package containing MV + BBQ that I can use to reproduce the issue ?
Ciao,
Germain
Hi Germain,
Hi Patrick,
I used the face detect kernel which can be launched from tests/vision/Face-Detect.
However to test the quotas, I’ve directly made patches in the runtime to put faked quotas, so at the end it will be difficult for you to replicate that.
Bye,
Germain
From: bosp-...@googlegroups.com [mailto:bosp-...@googlegroups.com] On Behalf Of Patrick Bellasi
Sent: Wednesday, April 10, 2013 1:03 PM
To: bosp-...@googlegroups.com
Cc: Germain HAUGOU
Subject: Re: SThorm Power Budget Control - Mechanisms & Policy
On Wed, Apr 10, 2013 at 12:23 PM, Edoardo Paone <pa...@elet.polimi.it> wrote:
--
Hi Patrick,
I used the face detect kernel which can be launched from tests/vision/Face-Detect.
However to test the quotas, I’ve directly made patches in the runtime to put faked quotas, so at the end it will be difficult for you to replicate that.
Bye,
Germain
Hi Edoardo,
in fact this is a compilation issue. When we compile face detection, we put an invalid flag pointed to a non-existent library. At the end on our side the linker is not complaining and the execution runs fine. We saw the issue this week because we have tried to run it through gdb and it was complaining about that. This issue is now fixed, I will send you a SDK soon. On your side, is it blocking the linking phase or the execution ?
Germain
From: bosp-...@googlegroups.com [mailto:bosp-...@googlegroups.com] On Behalf Of Edoardo Paone
Sent: Wednesday, April 10, 2013 5:38 PM
To: bosp-...@googlegroups.com
Cc: Germain HAUGOU
Subject: Re: SThorm Power Budget Control - Mechanisms & Policy
Hi Germain,
This is very strange on our side there was no issue. This library does not exist since a long time, you can just take any library and copy it with the same name, this should work.
Germain
Hi Patrick,
I think the OpenCL examples are not good candidates because they don’t stress a lot the architecture. I hope you will be able to integrate face detection because with it we can configure the number of clusters, frames, etc, it is more interesting. Moreover it seems we’ll release the source code of this application end of April.
Ciao,
Germain
From: Patrick Bellasi [mailto:derk...@gmail.com]
Sent: Wednesday, April 10, 2013 1:19 PM
To: bosp-...@googlegroups.com; Germain HAUGOU
Subject: Re: SThorm Power Budget Control - Mechanisms & Policy
On Wed, Apr 10, 2013 at 1:06 PM, Germain HAUGOU <germain...@st.com> wrote:
--
You received this message because you are subscribed to the Google Groups "BOSP Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bosp-devel+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Giuseppe,
indeed it already fills-in the energy data. The only things to do is to add the option --power to p12run and use the protocol I’ve sent. The runtime will write a value only if the field hostReady is set to 1.
Bye,
Germain
Hi Edoardo,
thanks a lot for the instructions, I was able to debug the issue.
The application is indeed executing 4 work-groups during 50% and 1 work-group during 50% of the time thus we should see the impact of the quotas.
The issue is that I forgot the OpenCL runtime needs to be informed of the execution ID. In the previous face detection integration we did some time ago, there was this code for registering it :
FaceDetectEXC::FaceDetectEXC(char *argv[],
std::string const & name,
std::string const & recipe,
RTLIB_Services_t * rtlib) :
BbqueEXC("fd", "facedetection", rtlib) {
char *execIdStr = (char *)malloc(256);
snprintf(execIdStr, 256, "%d", GetUid());
setenv("P2012_EXC_ID", execIdStr, 1);
picture_path = argv[1];
accuracy = atoi(argv[2]);
face_min = atoi(argv[3]);
face_max = atoi(argv[4]);
width = 512;
height = 512;
image_type = 1;
size = width*height;
data = (unsigned char *)malloc(size*3);
}
In your case you should add the following lines before you start using the OpenCL runtime:
char *execIdStr = (char *)malloc(256);
snprintf(execIdStr, 256, "%d", GetUid());
setenv("P2012_EXC_ID", execIdStr, 1);
This is used by the OpenCL runtime to know which constraint corresponds to which process. Could you integrate that in your code and sends me again the binaries ?
Ciao,
Germain
From: Edoardo Paone [mailto:pa...@elet.polimi.it]
Sent: Wednesday, April 10, 2013 12:24 PM
To: bosp-...@googlegroups.com
Cc: Germain HAUGOU
Subject: Re: SThorm Power Budget Control - Mechanisms & Policy
Hi Germain,
---------------------------------------------------------
Edoardo Paone
Ph.D. student
Politecnico di Milano
Dipartimento di Elettronica e Informazione
Via Giuseppe Ponzio 34/5
20133 Milano, Italy
Office: +39.02.2399.9688
E-mail: pa...@elet.polimi.it
--
The issue is that I forgot the OpenCL runtime needs to be informed of the execution ID. In the previous face detection integration we did some time ago, there was this code for registering it :
FaceDetectEXC::FaceDetectEXC(char *argv[],
std::string const & name,
std::string const & recipe,
RTLIB_Services_t * rtlib) :
BbqueEXC("fd", "facedetection", rtlib) {
char *execIdStr = (char *)malloc(256);
snprintf(execIdStr, 256, "%d", GetUid());
setenv("P2012_EXC_ID", execIdStr, 1);
picture_path = argv[1];
accuracy = atoi(argv[2]);
face_min = atoi(argv[3]);
face_max = atoi(argv[4]);
width = 512;
height = 512;
image_type = 1;
size = width*height;
data = (unsigned char *)malloc(size*3);
}
In your case you should add the following lines before you start using the OpenCL runtime:
char *execIdStr = (char *)malloc(256);
snprintf(execIdStr, 256, "%d", GetUid());
setenv("P2012_EXC_ID", execIdStr, 1);
This is used by the OpenCL runtime to know which constraint corresponds to which process. Could you integrate that in your code and sends me again the binaries ?
Hi Patrick,
I think the best is that the RTlib sets this environment variable, this will avoid OPenCL extensions which at always at the end painfull.
Indeed, looking into my old mails I recovered this one sent in November:
Hi Patrick, Giuseppe,
I have good news, I was able to make the connection between BBQ and the OpenCL runtime. For that I managed to get the UID and sends it to the fabric side, that now takes the corresponding constraint from the shared page. However I have a few problems that we should discuss:
- On Posix mode, the platform has no timing, thus the connection is only functional, the constraints are always respected.
- On ISS mode, I get some errors about timeout at the very beginning.
For the first point, there is nothing to do, this configuration will be used only for testing that we are able to run the applications. BBQ can still allocate resources but this no impact at the end on the scheduling.
For the second point, can I forward you the new SDK so that you reproduce the problem and have a look ? I would like to have more details about the error to understand if I can do something on platform on runtime side.
Ciao,
Germain
Indeed I have never sent you the sample code and we have stopped working on that after, probably because I switched to the porting on the eval board at this moment.
Ciao,
Germain
From: bosp-...@googlegroups.com [mailto:bosp-...@googlegroups.com] On Behalf Of Patrick Bellasi
Sent: Thursday, April 11, 2013 10:30 AM
To: bosp-...@googlegroups.com
Cc: Edoardo Paone
Subject: Re: SThorm Power Budget Control - Mechanisms & Policy
On Wed, Apr 10, 2013 at 9:56 PM, Germain HAUGOU <germain...@st.com> wrote:
--
Hi Patrick,
I think the best is that the RTlib sets this environment variable, this will avoid OPenCL extensions which at always at the end painfull.
Indeed I have never sent you the sample code and we have stopped working on that after, probably because I switched to the porting on the eval board at this moment.
Ciao,
Germain
Hi Patrick,
I need this environment variable when the first OpenCL API function is called because I read it only once during initialization. Thus we need to carefully choose where to put it. Do you have a way to make sure no OCL function is called before you set it ?
Ciao,
Germain
From: Patrick Bellasi [mailto:derk...@gmail.com]
Sent: Thursday, April 11, 2013 11:00 AM
To: bosp-...@googlegroups.com; Germain HAUGOU
Cc: Edoardo Paone
Subject: Re: SThorm Power Budget Control - Mechanisms & Policy
On Thu, Apr 11, 2013 at 10:36 AM, Germain HAUGOU <germain...@st.com> wrote:
I need this environment variable when the first OpenCL API function is called because I read it only once during initialization. Thus we need to carefully choose where to put it. Do you have a way to make sure no OCL function is called before you set it ?
Ciao,
Germain