You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mesos.apache.org by Neil Conway <ne...@gmail.com> on 2016/02/12 23:25:30 UTC

Precision of scalar resources

tl;dr:

If you use resource values with more than three decimal digits of
precision (e.g., you are launching a task that uses 2.5001 CPUs),
please speak up!

====

Mesos uses floating point to represent scalar resource values, such as
the number of CPUs in a resource offer or dynamic reservation. The
master does resource math in floating point, which leads to a few
problems:

* due to roundoff error, frameworks can receive offers that have
unexpected resource values (e.g., MESOS-3990)
* various internal assertions in the master can fail due to roundoff
error (e.g., MESOS-3552).

In the long term, we can solve these problems by switching to a
fixed-point representation for scalar values. However, that will
require a long deprecation cycle.

In the short term, we should make floating point behavior more
reliable. To do that, I propose:

(1) Resource values will support AT MOST three decimal digits of
precision. Additional precision in resource values will be discarded
(via rounding).

(2) The master will internally used a fixed-point representation to
avoid unpredictable roundoff behavior.

For more details, please see the design doc here:
https://docs.google.com/document/d/14qLxjZsfIpfynbx0USLJR0GELSq8hdZJUWw6kaY_DXc
-- comments welcome!

Thanks,
Neil

Re: Precision of scalar resources

Posted by Alexander Rojas <al...@mesosphere.io>.
+1

Strong initial first step to remove a huge headache.

> On 12 Feb 2016, at 14:25, Neil Conway <ne...@gmail.com> wrote:
> 
> Additional precision in resource values will be discarded
> (via rounding).


Re: Precision of scalar resources

Posted by Joris Van Remoortere <jo...@mesosphere.io>.
+1
Thanks for taking this on Neil!

—
*Joris Van Remoortere*
Mesosphere

On Fri, Feb 12, 2016 at 11:25 PM, Neil Conway <ne...@gmail.com> wrote:

> tl;dr:
>
> If you use resource values with more than three decimal digits of
> precision (e.g., you are launching a task that uses 2.5001 CPUs),
> please speak up!
>
> ====
>
> Mesos uses floating point to represent scalar resource values, such as
> the number of CPUs in a resource offer or dynamic reservation. The
> master does resource math in floating point, which leads to a few
> problems:
>
> * due to roundoff error, frameworks can receive offers that have
> unexpected resource values (e.g., MESOS-3990)
> * various internal assertions in the master can fail due to roundoff
> error (e.g., MESOS-3552).
>
> In the long term, we can solve these problems by switching to a
> fixed-point representation for scalar values. However, that will
> require a long deprecation cycle.
>
> In the short term, we should make floating point behavior more
> reliable. To do that, I propose:
>
> (1) Resource values will support AT MOST three decimal digits of
> precision. Additional precision in resource values will be discarded
> (via rounding).
>
> (2) The master will internally used a fixed-point representation to
> avoid unpredictable roundoff behavior.
>
> For more details, please see the design doc here:
>
> https://docs.google.com/document/d/14qLxjZsfIpfynbx0USLJR0GELSq8hdZJUWw6kaY_DXc
> -- comments welcome!
>
> Thanks,
> Neil
>

Re: Precision of scalar resources

Posted by Jörg Schad <jo...@mesosphere.io>.
+1 (would really help some issues we are facing with the ArangoDB framework)

On Mon, Feb 15, 2016 at 8:55 AM, Benjamin Hindman
<be...@gmail.com> wrote:
> SGTM, thanks Neil!
>
> On Fri, Feb 12, 2016 at 2:25 PM, Neil Conway <ne...@gmail.com> wrote:
>
>> tl;dr:
>>
>> If you use resource values with more than three decimal digits of
>> precision (e.g., you are launching a task that uses 2.5001 CPUs),
>> please speak up!
>>
>> ====
>>
>> Mesos uses floating point to represent scalar resource values, such as
>> the number of CPUs in a resource offer or dynamic reservation. The
>> master does resource math in floating point, which leads to a few
>> problems:
>>
>> * due to roundoff error, frameworks can receive offers that have
>> unexpected resource values (e.g., MESOS-3990)
>> * various internal assertions in the master can fail due to roundoff
>> error (e.g., MESOS-3552).
>>
>> In the long term, we can solve these problems by switching to a
>> fixed-point representation for scalar values. However, that will
>> require a long deprecation cycle.
>>
>> In the short term, we should make floating point behavior more
>> reliable. To do that, I propose:
>>
>> (1) Resource values will support AT MOST three decimal digits of
>> precision. Additional precision in resource values will be discarded
>> (via rounding).
>>
>> (2) The master will internally used a fixed-point representation to
>> avoid unpredictable roundoff behavior.
>>
>> For more details, please see the design doc here:
>>
>> https://docs.google.com/document/d/14qLxjZsfIpfynbx0USLJR0GELSq8hdZJUWw6kaY_DXc
>> -- comments welcome!
>>
>> Thanks,
>> Neil
>>

Re: Precision of scalar resources

Posted by Jörg Schad <jo...@mesosphere.io>.
+1 (would really help some issues we are facing with the ArangoDB framework)

On Mon, Feb 15, 2016 at 8:55 AM, Benjamin Hindman
<be...@gmail.com> wrote:
> SGTM, thanks Neil!
>
> On Fri, Feb 12, 2016 at 2:25 PM, Neil Conway <ne...@gmail.com> wrote:
>
>> tl;dr:
>>
>> If you use resource values with more than three decimal digits of
>> precision (e.g., you are launching a task that uses 2.5001 CPUs),
>> please speak up!
>>
>> ====
>>
>> Mesos uses floating point to represent scalar resource values, such as
>> the number of CPUs in a resource offer or dynamic reservation. The
>> master does resource math in floating point, which leads to a few
>> problems:
>>
>> * due to roundoff error, frameworks can receive offers that have
>> unexpected resource values (e.g., MESOS-3990)
>> * various internal assertions in the master can fail due to roundoff
>> error (e.g., MESOS-3552).
>>
>> In the long term, we can solve these problems by switching to a
>> fixed-point representation for scalar values. However, that will
>> require a long deprecation cycle.
>>
>> In the short term, we should make floating point behavior more
>> reliable. To do that, I propose:
>>
>> (1) Resource values will support AT MOST three decimal digits of
>> precision. Additional precision in resource values will be discarded
>> (via rounding).
>>
>> (2) The master will internally used a fixed-point representation to
>> avoid unpredictable roundoff behavior.
>>
>> For more details, please see the design doc here:
>>
>> https://docs.google.com/document/d/14qLxjZsfIpfynbx0USLJR0GELSq8hdZJUWw6kaY_DXc
>> -- comments welcome!
>>
>> Thanks,
>> Neil
>>

Re: Precision of scalar resources

Posted by Benjamin Hindman <be...@gmail.com>.
SGTM, thanks Neil!

On Fri, Feb 12, 2016 at 2:25 PM, Neil Conway <ne...@gmail.com> wrote:

> tl;dr:
>
> If you use resource values with more than three decimal digits of
> precision (e.g., you are launching a task that uses 2.5001 CPUs),
> please speak up!
>
> ====
>
> Mesos uses floating point to represent scalar resource values, such as
> the number of CPUs in a resource offer or dynamic reservation. The
> master does resource math in floating point, which leads to a few
> problems:
>
> * due to roundoff error, frameworks can receive offers that have
> unexpected resource values (e.g., MESOS-3990)
> * various internal assertions in the master can fail due to roundoff
> error (e.g., MESOS-3552).
>
> In the long term, we can solve these problems by switching to a
> fixed-point representation for scalar values. However, that will
> require a long deprecation cycle.
>
> In the short term, we should make floating point behavior more
> reliable. To do that, I propose:
>
> (1) Resource values will support AT MOST three decimal digits of
> precision. Additional precision in resource values will be discarded
> (via rounding).
>
> (2) The master will internally used a fixed-point representation to
> avoid unpredictable roundoff behavior.
>
> For more details, please see the design doc here:
>
> https://docs.google.com/document/d/14qLxjZsfIpfynbx0USLJR0GELSq8hdZJUWw6kaY_DXc
> -- comments welcome!
>
> Thanks,
> Neil
>

Re: Precision of scalar resources

Posted by Alexander Rojas <al...@mesosphere.io>.
+1

Strong initial first step to remove a huge headache.

> On 12 Feb 2016, at 14:25, Neil Conway <ne...@gmail.com> wrote:
> 
> Additional precision in resource values will be discarded
> (via rounding).


Re: Precision of scalar resources

Posted by Joris Van Remoortere <jo...@mesosphere.io>.
+1
Thanks for taking this on Neil!

—
*Joris Van Remoortere*
Mesosphere

On Fri, Feb 12, 2016 at 11:25 PM, Neil Conway <ne...@gmail.com> wrote:

> tl;dr:
>
> If you use resource values with more than three decimal digits of
> precision (e.g., you are launching a task that uses 2.5001 CPUs),
> please speak up!
>
> ====
>
> Mesos uses floating point to represent scalar resource values, such as
> the number of CPUs in a resource offer or dynamic reservation. The
> master does resource math in floating point, which leads to a few
> problems:
>
> * due to roundoff error, frameworks can receive offers that have
> unexpected resource values (e.g., MESOS-3990)
> * various internal assertions in the master can fail due to roundoff
> error (e.g., MESOS-3552).
>
> In the long term, we can solve these problems by switching to a
> fixed-point representation for scalar values. However, that will
> require a long deprecation cycle.
>
> In the short term, we should make floating point behavior more
> reliable. To do that, I propose:
>
> (1) Resource values will support AT MOST three decimal digits of
> precision. Additional precision in resource values will be discarded
> (via rounding).
>
> (2) The master will internally used a fixed-point representation to
> avoid unpredictable roundoff behavior.
>
> For more details, please see the design doc here:
>
> https://docs.google.com/document/d/14qLxjZsfIpfynbx0USLJR0GELSq8hdZJUWw6kaY_DXc
> -- comments welcome!
>
> Thanks,
> Neil
>

Re: Precision of scalar resources

Posted by Benjamin Hindman <be...@gmail.com>.
SGTM, thanks Neil!

On Fri, Feb 12, 2016 at 2:25 PM, Neil Conway <ne...@gmail.com> wrote:

> tl;dr:
>
> If you use resource values with more than three decimal digits of
> precision (e.g., you are launching a task that uses 2.5001 CPUs),
> please speak up!
>
> ====
>
> Mesos uses floating point to represent scalar resource values, such as
> the number of CPUs in a resource offer or dynamic reservation. The
> master does resource math in floating point, which leads to a few
> problems:
>
> * due to roundoff error, frameworks can receive offers that have
> unexpected resource values (e.g., MESOS-3990)
> * various internal assertions in the master can fail due to roundoff
> error (e.g., MESOS-3552).
>
> In the long term, we can solve these problems by switching to a
> fixed-point representation for scalar values. However, that will
> require a long deprecation cycle.
>
> In the short term, we should make floating point behavior more
> reliable. To do that, I propose:
>
> (1) Resource values will support AT MOST three decimal digits of
> precision. Additional precision in resource values will be discarded
> (via rounding).
>
> (2) The master will internally used a fixed-point representation to
> avoid unpredictable roundoff behavior.
>
> For more details, please see the design doc here:
>
> https://docs.google.com/document/d/14qLxjZsfIpfynbx0USLJR0GELSq8hdZJUWw6kaY_DXc
> -- comments welcome!
>
> Thanks,
> Neil
>