private Frame directSVD(DataInfo dinfo, Frame qfrm, SVDModel model) { String u_name = (_parms._u_name == null || _parms._u_name.length() == 0) ? "SVDUMatrix_" + Key.rand() : _parms._u_name; return directSVD(dinfo, qfrm, model, u_name); } private Frame directSVD(DataInfo dinfo, Frame qfrm, SVDModel model, String u_name) {
public static Key<CompressedTree> makeTreeKey(int treeId, int clazz) { return Key.makeSystem("tree_" + treeId + "_" + clazz + "_" + Key.rand()); }
protected Key defaultDestKey() { return Key.make(getClass().getSimpleName() + Key.rand()); }
private Key defaultTreeKey() { return Key.makeSystem("__Tree_"+Key.rand()); }
static public Key make(byte rf, byte systemType, H2ONode... replicas) { return make(rand(),rf,systemType,replicas); }
static public Key make() { return make(rand()); }
String uid = Key.rand(); ClassMap renames = new ClassMap(); for( JarEntry entry : entries ) {
public T invokeOnAllNodes() { H2O cloud = H2O.CLOUD; Key[] args = new Key[cloud.size()]; String skey = "RunOnAll"+Key.rand(); for( int i = 0; i < args.length; ++i ) args[i] = Key.make(skey,(byte)0,Key.DFJ_INTERNAL_USER,cloud._memary[i]); invoke(args); for( Key arg : args ) DKV.remove(arg); return self(); }
/** * Rebalance a frame for load balancing * @param fr Input frame * @param local whether to only create enough chunks to max out all cores on one node only * @return Frame that has potentially more chunks */ private Frame reBalance(final Frame fr, boolean local) { int chunks = (int)Math.min( 4 * H2O.NUMCPUS * (local ? 1 : H2O.CLOUD.size()), fr.numRows()); if (fr.anyVec().nChunks() > chunks && !reproducible) { Log.info("Dataset already contains " + fr.anyVec().nChunks() + " chunks. No need to rebalance."); return fr; } else if (reproducible) { Log.warn("Reproducibility enforced - using only 1 thread - can be slow."); chunks = 1; } if (!quiet_mode) Log.info("ReBalancing dataset into (at least) " + chunks + " chunks."); // return MRUtils.shuffleAndBalance(fr, chunks, seed, local, shuffle_training_data); String snewKey = fr._key != null ? (fr._key.toString() + ".balanced") : Key.rand(); Key newKey = Key.makeSystem(snewKey); RebalanceDataSet rb = new RebalanceDataSet(fr, newKey, chunks); H2O.submitTask(rb); rb.join(); return UKV.get(newKey); }
DKV.put(userKeys[i] = Key.make("key" + i), new Utils.IcedInt(i),fs); if(userKeys[i].home())++homeKeys; systemKeys[i] = Key.makeSystem(Key.rand()); DKV.put(systemKeys[i], new Value(systemKeys[i], new Utils.IcedInt(i)),fs); DKV.put(userKeys[i] = Key.make("key" + i), new Utils.IcedDouble(i),fs); if(userKeys[i].home())++homeKeys; systemKeys[i] = Key.makeSystem(Key.rand()); DKV.put(systemKeys[i], new Value(systemKeys[i], new Utils.IcedDouble(i)),fs);
Key<Grid> gridKey = Key.make("GLRM_grid_iris" + Key.rand());
try { for (int i = 0; i < 1e2; ++i) { Key k = Key.makeSystem(Key.rand()); keys.add(k); DKV.put(k, new Value(k, new Utils.IcedInt(i)));
Key<Grid> gridKey = Key.make("GLRM_grid_iris" + Key.rand()); for (int i = 0; i < ITER_CNT; i++) { Job<Grid> gs = GridSearch.startGridSearch(gridKey, params, hyperParms);
@Test public void testLocalKeySet(){ Key [] userKeys = new Key[100]; Key [] systemKeys = new Key[100]; int homeKeys = 0; Futures fs = new Futures(); try { for( int i = 0; i < userKeys.length; ++i ) { DKV.put(userKeys[i] = Key.make("key" + i), new Utils.IcedInt(i),fs,true); if( userKeys[i].home() ) ++homeKeys; DKV.put(systemKeys[i] = Key.makeSystem(Key.rand()), new Utils.IcedInt(i),fs,true); } fs.blockForPending(); Key[] keys = H2O.KeySnapshot.localSnapshot().keys(); Assert.assertEquals(homeKeys, keys.length); for (Key k:keys) Assert.assertTrue(k.home()); } finally { for (int i = 0; i < userKeys.length; ++i) { DKV.remove(userKeys[i],fs); DKV.remove(systemKeys[i],fs); } fs.blockForPending(); } }
@Test public void testGlobalKeySet(){ Key keys[] = new Key[100]; Futures fs = new Futures(); try { for (int i = 0; i < 100; ++i) DKV.put(Key.make("key" + i), new Utils.IcedInt(i),fs,true); for( int i = 0; i < 100; ++i) DKV.put(keys[i] = Key.makeSystem(Key.rand()), new Utils.IcedInt(i),fs,true); fs.blockForPending(); Key[] keys2 = H2O.KeySnapshot.globalSnapshot().keys(); Assert.assertEquals(100, keys2.length); } finally { for (int i = 0; i < 100; ++i) { DKV.remove(Key.make("key" + i),fs); DKV.remove(keys[i],fs); } fs.blockForPending(); } }
"GLRMLoading_" + Key.rand() : _parms._representation_name; model._output._representation_key = Key.make(model._output._representation_name);
private Frame directSVD(DataInfo dinfo, Frame qfrm, SVDModel model) { String u_name = (_parms._u_name == null || _parms._u_name.length() == 0) ? "SVDUMatrix_" + Key.rand() : _parms._u_name; return directSVD(dinfo, qfrm, model, u_name); } private Frame directSVD(DataInfo dinfo, Frame qfrm, SVDModel model, String u_name) {
public static Key<CompressedTree> makeTreeKey(int treeId, int clazz) { return Key.makeSystem("tree_" + treeId + "_" + clazz + "_" + Key.rand()); }