You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by thunterdb <gi...@git.apache.org> on 2016/04/12 20:57:16 UTC

[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

GitHub user thunterdb opened a pull request:

    https://github.com/apache/spark/pull/12331

    [SPARK-14568][ML] Instrumentation framework for logistic regression

    ## What changes were proposed in this pull request?
    
    This adds extra logging information about a `LogisticRegression` estimator when being fit on a dataset. With this PR, you see the following extra lines when running the example in the documentation:
    
    ```
    16/04/12 11:48:07 INFO Instrumentation: Instrumentation(LogisticRegression-logreg_a89eb23cb386-358781145):training: numPartitions=1 storageLevel=StorageLevel(disk=true, memory=true, offheap=false, deserialized=true, replication=1)
    16/04/12 11:48:07 INFO Instrumentation: Instrumentation(LogisticRegression-logreg_a89eb23cb386-358781145):regParam=0.3 elasticNetParam=0.8 maxIter=10
    ...
    16/04/12 11:48:07 INFO Instrumentation: Instrumentation(LogisticRegression-logreg_a89eb23cb386-358781145):numClasses=2
    16/04/12 11:48:07 INFO Instrumentation: Instrumentation(LogisticRegression-logreg_a89eb23cb386-358781145):numFeatures=692
    ...
    16/04/12 11:48:08 INFO Instrumentation: Instrumentation(LogisticRegression-logreg_a89eb23cb386-358781145):training finished
    ```
    
    ## How was this patch tested?
    
    This PR was manually tested.
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/thunterdb/spark 1604-instrumentation

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/12331.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #12331
    
----
commit bd73c5b1dc4f5448806d910d2267f4ef6fe5d9eb
Author: Timothy Hunter <ti...@databricks.com>
Date:   2016-04-12T18:38:57Z

    work

commit 0ca109408005d7ed8971e583fec8027ef7c34c9e
Author: Timothy Hunter <ti...@databricks.com>
Date:   2016-04-12T18:56:58Z

    documentation and fixes

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12331#discussion_r59468142
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala ---
    @@ -273,6 +273,10 @@ class LogisticRegression @Since("1.2.0") (
     
         if (handlePersistence) instances.persist(StorageLevel.MEMORY_AND_DISK)
     
    +    val instr = Instrumentation.create(this, instances)
    +    instr.logParams(regParam, elasticNetParam, standardization, threshold,
    --- End diff --
    
    How about just ```instr.logParams(getParams :_*)```?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209055975
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/55632/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12331#discussion_r59468154
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/util/Instrumentation.scala ---
    @@ -0,0 +1,109 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.ml.util
    +
    +import java.util.concurrent.atomic.AtomicLong
    +
    +import org.apache.spark.internal.Logging
    +import org.apache.spark.ml.{Estimator, Model}
    +import org.apache.spark.ml.param.Param
    +import org.apache.spark.rdd.RDD
    +import org.apache.spark.sql.Dataset
    +
    +/**
    + * A small wrapper that defines a training session for an estimator, and some methods to log
    + * useful information during this session.
    + *
    + * A new class is expected to be created within fit().
    + *
    + * @param estimator the estimator that is being fit
    + * @param dataset the training dataset
    + * @tparam E the type of the estimator
    + */
    +private[ml] class Instrumentation[E <: Estimator[_]] private (
    +    estimator: E, dataset: RDD[_]) extends Logging {
    +  private val id = Instrumentation.counter.incrementAndGet()
    +  init()
    +
    +  private def init(): Unit = {
    +    log(s"training: numPartitions=${dataset.partitions.length}" +
    +      s" storageLevel=${dataset.getStorageLevel}")
    +  }
    +
    +  /**
    +   * Logs a message with a prefix that uniquely identifies the prefix session.
    --- End diff --
    
    "prefix session" --> "training session"


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209474148
  
    Merged build finished. Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12331#discussion_r59468165
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/util/Instrumentation.scala ---
    @@ -0,0 +1,109 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.ml.util
    +
    +import java.util.concurrent.atomic.AtomicLong
    +
    +import org.apache.spark.internal.Logging
    +import org.apache.spark.ml.{Estimator, Model}
    +import org.apache.spark.ml.param.Param
    +import org.apache.spark.rdd.RDD
    +import org.apache.spark.sql.Dataset
    +
    +/**
    + * A small wrapper that defines a training session for an estimator, and some methods to log
    + * useful information during this session.
    + *
    + * A new class is expected to be created within fit().
    + *
    + * @param estimator the estimator that is being fit
    + * @param dataset the training dataset
    + * @tparam E the type of the estimator
    + */
    +private[ml] class Instrumentation[E <: Estimator[_]] private (
    +    estimator: E, dataset: RDD[_]) extends Logging {
    +  private val id = Instrumentation.counter.incrementAndGet()
    +  init()
    +
    +  private def init(): Unit = {
    +    log(s"training: numPartitions=${dataset.partitions.length}" +
    +      s" storageLevel=${dataset.getStorageLevel}")
    +  }
    +
    +  /**
    +   * Logs a message with a prefix that uniquely identifies the prefix session.
    +   */
    +  def log(msg: String): Unit = {
    +    val className = estimator.getClass.getSimpleName
    +    logInfo(s"Instrumentation($className-${estimator.uid}-${dataset.hashCode()}-$id): $msg")
    +  }
    +
    +  /**
    +   * Logs the value of the given parameters for the estimator being used in this session.
    + *
    +   * @param params
    +   */
    +  def logParams(params: Param[_]*): Unit = {
    +    val pairs = for {
    --- End diff --
    
    It would be nice to use a more standard format here, such as JSON.  You could copy it from ```DefaultParamsWriter.getMetadataToSave```.
    Taking a list of params here, rather than extracting all, is reasonable since not all Params will be JSON-serializable.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by thunterdb <gi...@git.apache.org>.
Github user thunterdb commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209124853
  
    cc @mengxr 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209135999
  
    Should we change all existing logging messages in LogisticRegression to use Instrumentation?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/12331


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12331#discussion_r59593603
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala ---
    @@ -273,6 +273,10 @@ class LogisticRegression @Since("1.2.0") (
     
         if (handlePersistence) instances.persist(StorageLevel.MEMORY_AND_DISK)
     
    +    val instr = Instrumentation.create(this, instances)
    +    instr.logParams(regParam, elasticNetParam, standardization, threshold,
    --- End diff --
    
    Fair enough.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209476490
  
    Merged build finished. Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12331#discussion_r59468146
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/util/Instrumentation.scala ---
    @@ -0,0 +1,109 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.ml.util
    +
    +import java.util.concurrent.atomic.AtomicLong
    +
    +import org.apache.spark.internal.Logging
    +import org.apache.spark.ml.{Estimator, Model}
    +import org.apache.spark.ml.param.Param
    +import org.apache.spark.rdd.RDD
    +import org.apache.spark.sql.Dataset
    +
    +/**
    + * A small wrapper that defines a training session for an estimator, and some methods to log
    + * useful information during this session.
    + *
    + * A new class is expected to be created within fit().
    --- End diff --
    
    A new instance


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209132617
  
    I'll take a look


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209055971
  
    Merged build finished. Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by thunterdb <gi...@git.apache.org>.
Github user thunterdb commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12331#discussion_r59557130
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/util/Instrumentation.scala ---
    @@ -0,0 +1,109 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.ml.util
    +
    +import java.util.concurrent.atomic.AtomicLong
    +
    +import org.apache.spark.internal.Logging
    +import org.apache.spark.ml.{Estimator, Model}
    +import org.apache.spark.ml.param.Param
    +import org.apache.spark.rdd.RDD
    +import org.apache.spark.sql.Dataset
    +
    +/**
    + * A small wrapper that defines a training session for an estimator, and some methods to log
    + * useful information during this session.
    + *
    + * A new class is expected to be created within fit().
    + *
    + * @param estimator the estimator that is being fit
    + * @param dataset the training dataset
    + * @tparam E the type of the estimator
    + */
    +private[ml] class Instrumentation[E <: Estimator[_]] private (
    +    estimator: E, dataset: RDD[_]) extends Logging {
    +  private val id = Instrumentation.counter.incrementAndGet()
    +  init()
    +
    +  private def init(): Unit = {
    +    log(s"training: numPartitions=${dataset.partitions.length}" +
    +      s" storageLevel=${dataset.getStorageLevel}")
    +  }
    +
    +  /**
    +   * Logs a message with a prefix that uniquely identifies the prefix session.
    --- End diff --
    
    thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209475924
  
    **[Test build #55715 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/55715/consoleFull)** for PR 12331 at commit [`745a103`](https://github.com/apache/spark/commit/745a10385314adc0fc3597802217d9cfe403786c).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209503620
  
    **[Test build #55716 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/55716/consoleFull)** for PR 12331 at commit [`a824d90`](https://github.com/apache/spark/commit/a824d9073497853fc8c9f200abceb51801fbeb8e).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209476494
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/55715/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209473734
  
    **[Test build #55714 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/55714/consoleFull)** for PR 12331 at commit [`0299d8b`](https://github.com/apache/spark/commit/0299d8ba399a299eac6289946d940959a392d070).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12331#discussion_r59468156
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/util/Instrumentation.scala ---
    @@ -0,0 +1,109 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.ml.util
    +
    +import java.util.concurrent.atomic.AtomicLong
    +
    +import org.apache.spark.internal.Logging
    +import org.apache.spark.ml.{Estimator, Model}
    +import org.apache.spark.ml.param.Param
    +import org.apache.spark.rdd.RDD
    +import org.apache.spark.sql.Dataset
    +
    +/**
    + * A small wrapper that defines a training session for an estimator, and some methods to log
    + * useful information during this session.
    + *
    + * A new class is expected to be created within fit().
    + *
    + * @param estimator the estimator that is being fit
    + * @param dataset the training dataset
    + * @tparam E the type of the estimator
    + */
    +private[ml] class Instrumentation[E <: Estimator[_]] private (
    +    estimator: E, dataset: RDD[_]) extends Logging {
    +  private val id = Instrumentation.counter.incrementAndGet()
    +  init()
    +
    +  private def init(): Unit = {
    +    log(s"training: numPartitions=${dataset.partitions.length}" +
    +      s" storageLevel=${dataset.getStorageLevel}")
    +  }
    +
    +  /**
    +   * Logs a message with a prefix that uniquely identifies the prefix session.
    +   */
    +  def log(msg: String): Unit = {
    +    val className = estimator.getClass.getSimpleName
    +    logInfo(s"Instrumentation($className-${estimator.uid}-${dataset.hashCode()}-$id): $msg")
    --- End diff --
    
    Only compute this identifier once, outside this method


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12331#discussion_r59468170
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/util/Instrumentation.scala ---
    @@ -0,0 +1,109 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.ml.util
    +
    +import java.util.concurrent.atomic.AtomicLong
    +
    +import org.apache.spark.internal.Logging
    +import org.apache.spark.ml.{Estimator, Model}
    +import org.apache.spark.ml.param.Param
    +import org.apache.spark.rdd.RDD
    +import org.apache.spark.sql.Dataset
    +
    +/**
    + * A small wrapper that defines a training session for an estimator, and some methods to log
    + * useful information during this session.
    + *
    + * A new class is expected to be created within fit().
    + *
    + * @param estimator the estimator that is being fit
    + * @param dataset the training dataset
    + * @tparam E the type of the estimator
    + */
    +private[ml] class Instrumentation[E <: Estimator[_]] private (
    +    estimator: E, dataset: RDD[_]) extends Logging {
    +  private val id = Instrumentation.counter.incrementAndGet()
    +  init()
    +
    +  private def init(): Unit = {
    +    log(s"training: numPartitions=${dataset.partitions.length}" +
    +      s" storageLevel=${dataset.getStorageLevel}")
    +  }
    +
    +  /**
    +   * Logs a message with a prefix that uniquely identifies the prefix session.
    +   */
    +  def log(msg: String): Unit = {
    +    val className = estimator.getClass.getSimpleName
    +    logInfo(s"Instrumentation($className-${estimator.uid}-${dataset.hashCode()}-$id): $msg")
    +  }
    +
    +  /**
    +   * Logs the value of the given parameters for the estimator being used in this session.
    + *
    +   * @param params
    +   */
    +  def logParams(params: Param[_]*): Unit = {
    +    val pairs = for {
    +      p <- params
    +      value <- estimator.get(p)
    +    } yield {
    +      s"${p.name}=$value"
    +    }
    +    log(s"${pairs.mkString(" ")}")
    +  }
    +
    +  def logNumFeatures(num: Long): Unit = {
    +    log(s"numFeatures=$num")
    +  }
    +
    +  def logNumClasses(num: Long): Unit = {
    +    log(s"numClasses=$num")
    +  }
    +
    +  /**
    +   * Logs the successful completion of the training session and the value of the learned model.
    +   */
    +  def logSuccess(model: Model[_]): Unit = {
    --- End diff --
    
    Did you mean to log something about the model here?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by thunterdb <gi...@git.apache.org>.
Github user thunterdb commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12331#discussion_r59557115
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/util/Instrumentation.scala ---
    @@ -0,0 +1,109 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.ml.util
    +
    +import java.util.concurrent.atomic.AtomicLong
    +
    +import org.apache.spark.internal.Logging
    +import org.apache.spark.ml.{Estimator, Model}
    +import org.apache.spark.ml.param.Param
    +import org.apache.spark.rdd.RDD
    +import org.apache.spark.sql.Dataset
    +
    +/**
    + * A small wrapper that defines a training session for an estimator, and some methods to log
    + * useful information during this session.
    + *
    + * A new class is expected to be created within fit().
    --- End diff --
    
    Done


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209100564
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/55642/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by thunterdb <gi...@git.apache.org>.
Github user thunterdb commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12331#discussion_r59478228
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala ---
    @@ -273,6 +273,10 @@ class LogisticRegression @Since("1.2.0") (
     
         if (handlePersistence) instances.persist(StorageLevel.MEMORY_AND_DISK)
     
    +    val instr = Instrumentation.create(this, instances)
    +    instr.logParams(regParam, elasticNetParam, standardization, threshold,
    --- End diff --
    
    My concern here was not to log some large values such as `thresholds` (in the case of multiclass). Otherwise, we may swamp the logs with very large vectors, which is not the point of these statistics.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209476483
  
    **[Test build #55715 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/55715/consoleFull)** for PR 12331 at commit [`745a103`](https://github.com/apache/spark/commit/745a10385314adc0fc3597802217d9cfe403786c).
     * This patch **fails Scala style tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209136066
  
    Done with review pass


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209055965
  
    **[Test build #55632 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/55632/consoleFull)** for PR 12331 at commit [`0ca1094`](https://github.com/apache/spark/commit/0ca109408005d7ed8971e583fec8027ef7c34c9e).
     * This patch **fails Scala style tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209100562
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by thunterdb <gi...@git.apache.org>.
Github user thunterdb commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12331#discussion_r59557439
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/util/Instrumentation.scala ---
    @@ -0,0 +1,109 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.ml.util
    +
    +import java.util.concurrent.atomic.AtomicLong
    +
    +import org.apache.spark.internal.Logging
    +import org.apache.spark.ml.{Estimator, Model}
    +import org.apache.spark.ml.param.Param
    +import org.apache.spark.rdd.RDD
    +import org.apache.spark.sql.Dataset
    +
    +/**
    + * A small wrapper that defines a training session for an estimator, and some methods to log
    + * useful information during this session.
    + *
    + * A new class is expected to be created within fit().
    + *
    + * @param estimator the estimator that is being fit
    + * @param dataset the training dataset
    + * @tparam E the type of the estimator
    + */
    +private[ml] class Instrumentation[E <: Estimator[_]] private (
    +    estimator: E, dataset: RDD[_]) extends Logging {
    +  private val id = Instrumentation.counter.incrementAndGet()
    +  init()
    +
    +  private def init(): Unit = {
    +    log(s"training: numPartitions=${dataset.partitions.length}" +
    +      s" storageLevel=${dataset.getStorageLevel}")
    +  }
    +
    +  /**
    +   * Logs a message with a prefix that uniquely identifies the prefix session.
    +   */
    +  def log(msg: String): Unit = {
    +    val className = estimator.getClass.getSimpleName
    +    logInfo(s"Instrumentation($className-${estimator.uid}-${dataset.hashCode()}-$id): $msg")
    +  }
    +
    +  /**
    +   * Logs the value of the given parameters for the estimator being used in this session.
    + *
    +   * @param params
    +   */
    +  def logParams(params: Param[_]*): Unit = {
    +    val pairs = for {
    --- End diff --
    
    I am using json now. I have a (small) concern regarding the performance: in that method, we serialize to json and then parse the string to build the vector: `parse(cast.jsonEncode(value))`. It is not an issue here, but it does not look very optimal...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by thunterdb <gi...@git.apache.org>.
Github user thunterdb commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209478984
  
    @jkbradley comments addressed, thanks for the review! Regarding the other messages, I would rather not change them for now, because they are not instrumentation and because if we want to scope training sessions, we should use the scoping mechanism in `RDDOperationsScope` (or something similar that captures the sub-calls).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209474152
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/55714/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12331#discussion_r59468159
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/util/Instrumentation.scala ---
    @@ -0,0 +1,109 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.ml.util
    +
    +import java.util.concurrent.atomic.AtomicLong
    +
    +import org.apache.spark.internal.Logging
    +import org.apache.spark.ml.{Estimator, Model}
    +import org.apache.spark.ml.param.Param
    +import org.apache.spark.rdd.RDD
    +import org.apache.spark.sql.Dataset
    +
    +/**
    + * A small wrapper that defines a training session for an estimator, and some methods to log
    + * useful information during this session.
    + *
    + * A new class is expected to be created within fit().
    + *
    + * @param estimator the estimator that is being fit
    + * @param dataset the training dataset
    + * @tparam E the type of the estimator
    + */
    +private[ml] class Instrumentation[E <: Estimator[_]] private (
    +    estimator: E, dataset: RDD[_]) extends Logging {
    +  private val id = Instrumentation.counter.incrementAndGet()
    +  init()
    +
    +  private def init(): Unit = {
    +    log(s"training: numPartitions=${dataset.partitions.length}" +
    +      s" storageLevel=${dataset.getStorageLevel}")
    +  }
    +
    +  /**
    +   * Logs a message with a prefix that uniquely identifies the prefix session.
    +   */
    +  def log(msg: String): Unit = {
    +    val className = estimator.getClass.getSimpleName
    +    logInfo(s"Instrumentation($className-${estimator.uid}-${dataset.hashCode()}-$id): $msg")
    +  }
    +
    +  /**
    +   * Logs the value of the given parameters for the estimator being used in this session.
    + *
    --- End diff --
    
    space


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209504085
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/55716/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209504080
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209474144
  
    **[Test build #55714 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/55714/consoleFull)** for PR 12331 at commit [`0299d8b`](https://github.com/apache/spark/commit/0299d8ba399a299eac6289946d940959a392d070).
     * This patch **fails Scala style tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by thunterdb <gi...@git.apache.org>.
Github user thunterdb commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12331#discussion_r59557153
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/util/Instrumentation.scala ---
    @@ -0,0 +1,109 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.ml.util
    +
    +import java.util.concurrent.atomic.AtomicLong
    +
    +import org.apache.spark.internal.Logging
    +import org.apache.spark.ml.{Estimator, Model}
    +import org.apache.spark.ml.param.Param
    +import org.apache.spark.rdd.RDD
    +import org.apache.spark.sql.Dataset
    +
    +/**
    + * A small wrapper that defines a training session for an estimator, and some methods to log
    + * useful information during this session.
    + *
    + * A new class is expected to be created within fit().
    + *
    + * @param estimator the estimator that is being fit
    + * @param dataset the training dataset
    + * @tparam E the type of the estimator
    + */
    +private[ml] class Instrumentation[E <: Estimator[_]] private (
    +    estimator: E, dataset: RDD[_]) extends Logging {
    +  private val id = Instrumentation.counter.incrementAndGet()
    +  init()
    +
    +  private def init(): Unit = {
    +    log(s"training: numPartitions=${dataset.partitions.length}" +
    +      s" storageLevel=${dataset.getStorageLevel}")
    +  }
    +
    +  /**
    +   * Logs a message with a prefix that uniquely identifies the prefix session.
    +   */
    +  def log(msg: String): Unit = {
    +    val className = estimator.getClass.getSimpleName
    +    logInfo(s"Instrumentation($className-${estimator.uid}-${dataset.hashCode()}-$id): $msg")
    --- End diff --
    
    done


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12331#discussion_r59594046
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/util/Instrumentation.scala ---
    @@ -0,0 +1,109 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.ml.util
    +
    +import java.util.concurrent.atomic.AtomicLong
    +
    +import org.apache.spark.internal.Logging
    +import org.apache.spark.ml.{Estimator, Model}
    +import org.apache.spark.ml.param.Param
    +import org.apache.spark.rdd.RDD
    +import org.apache.spark.sql.Dataset
    +
    +/**
    + * A small wrapper that defines a training session for an estimator, and some methods to log
    + * useful information during this session.
    + *
    + * A new class is expected to be created within fit().
    + *
    + * @param estimator the estimator that is being fit
    + * @param dataset the training dataset
    + * @tparam E the type of the estimator
    + */
    +private[ml] class Instrumentation[E <: Estimator[_]] private (
    +    estimator: E, dataset: RDD[_]) extends Logging {
    +  private val id = Instrumentation.counter.incrementAndGet()
    +  init()
    +
    +  private def init(): Unit = {
    +    log(s"training: numPartitions=${dataset.partitions.length}" +
    +      s" storageLevel=${dataset.getStorageLevel}")
    +  }
    +
    +  /**
    +   * Logs a message with a prefix that uniquely identifies the prefix session.
    +   */
    +  def log(msg: String): Unit = {
    +    val className = estimator.getClass.getSimpleName
    +    logInfo(s"Instrumentation($className-${estimator.uid}-${dataset.hashCode()}-$id): $msg")
    +  }
    +
    +  /**
    +   * Logs the value of the given parameters for the estimator being used in this session.
    + *
    +   * @param params
    +   */
    +  def logParams(params: Param[_]*): Unit = {
    +    val pairs = for {
    --- End diff --
    
    Would you mind making a little JIRA for that?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209571949
  
    LGTM
    Merging with master
    Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209100387
  
    **[Test build #55642 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/55642/consoleFull)** for PR 12331 at commit [`0643df2`](https://github.com/apache/spark/commit/0643df2f792ef1d3f0853e6c1a11e17e2301e5da).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209055338
  
    **[Test build #55632 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/55632/consoleFull)** for PR 12331 at commit [`0ca1094`](https://github.com/apache/spark/commit/0ca109408005d7ed8971e583fec8027ef7c34c9e).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209480139
  
    **[Test build #55716 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/55716/consoleFull)** for PR 12331 at commit [`a824d90`](https://github.com/apache/spark/commit/a824d9073497853fc8c9f200abceb51801fbeb8e).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-14568][ML] Instrumentation framework fo...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/12331#issuecomment-209087790
  
    **[Test build #55642 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/55642/consoleFull)** for PR 12331 at commit [`0643df2`](https://github.com/apache/spark/commit/0643df2f792ef1d3f0853e6c1a11e17e2301e5da).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org