issue_start><issue_comment>Title: Improve CI speed
username_0: Our CI has been running slow recently.  Qing-Qing, <NAME>, Helin, <NAME>, Ya-ming, Yi-bing, and I discussed this issue and here are what we learned and what we are going to do:

#### A. Reduce the number of SM architectures

1. We are building many SM architectures in the CI: https://github.com/PaddlePaddle/Paddle/blob/develop/cmake/cuda.cmake.
1. According to the experiment of Qing-qing, https://github.com/PaddlePaddle/Paddle/issues/5491, nvcc could run faster if we generate less number of SM architectures.

Helin is going to configure the CI system to generate only one SM architecture when checking PRs, but generating all SM architecture code in the nightly build of the develop branch.

#### B. Migrate the CI system to two servers

We are running four TeamCity agents on four GPU desktops, each with one GPU and a desktop-level CPU (a few cores).  We have two idle servers, each with 6 GPUs and a powerful CPU with 56 cores.

Helin will migrate the CI system to the servers. 

#### C. Distribute unit tests to multiple GPUs

Our CI system runs unit tests by calling `ctest -j N`, where `N` is the number of processes that run unit tests in parallel. However, all these `N` processes are using the same GPU.

Qing-qing is going to study if we can make cmake/ctest to use more than one GPUs.

#### D.<issue_closed>
<issue_comment>username_2: After discussing with @dzhwinter, we have another simple idea.
We can cache the `thirdparty` in a Docker Image which bases on `paddle:latest-dev` so that we don't need to build the `thirdparty` repeatedly for each PR. 

Maybe the steps are as follows:
1. Check out the code and check the cmake files under `cmake/external`  or `Dockerfile` under the root folder have any update, if so:
    1. Rebuild a new Docker Image named `paddle:teamcity` which only contains the thirdparty.
    1. Push `paddle:teamcity` to the docker hub.
1. Build and run all the unit test with `paddle:teamcity`<commit_before>var _ = require('lodash');

var db = global.db;

var object = exports;

object.desc = "generic object store"
object.functions = {
	create: {desc: 'get object', params: {className:{dtype:'string'}, object:{dtype:'object'}}, security: []},
	destroy: {desc: 'get object', params: {oid:{dtype:'string'}}, security: []},
	get: {desc: 'get object', params: {className:{dtype:'string'}, oid:{dtype:'string'}}, security: []},
	set: {desc:'set object', params: {className:{dtype:'string'}, oid:{dtype:'string'}, object: {dtype: 'object'}}, security: []}
};

object.errors = {
	100: "get object failed",
	101: "set object failed",
	102: "set object failed, unable to load merge",
	103: "object already exists",
	104: "unable to save null object"
}

object.pre = function(req, res, cb)
{
	console.log('object.pre');
	var cmd = req.params.cmd;
	var className = req.params.className;
	var oid = req.params.oid;
	
	// SWD - eventually check security session.uid has rights to object
	
	req.env.object = null;
	db.kget('kObject', [className, oid], function(err, value){
		if(value == null) {
			if(cmd == 'object.create')
			{
				cb(0);  // create call and no object - ok
			} else {
				cb(100); // not create and no object - error
			}
			return;
		} else {
			if(cmd == 'object.create')
			{
				cb(103); // create and object exists - error
			} else {
				var object = JSON.parse(value);
				req.env.object = object;
				cb(0);
			}
			return;
		}
	});
}

object.post = function(req, res, cb)
{
	console.log('object.post');
	var object = req.env.object;
	
	if(req.env.object==null) {
		cb(104);
		return;
	}
	
	var objectStr = JSON.stringify(object);
	db.kset('kObject', [object.className, object.oid], objectStr, function(err, res) {
		if(err!= null) {
			cb(101);
			return;
		}
		cb(0);
	});
}

object.create = function(req, res, cb)
{
	console.log('object.create');
	var className = req.params.className;
	
	var object = {};
	db.nextId('object-' + className, function(error, value) {
		// create the object
		object.oid = value.toString();
		object.className = className;
		var ts = new Date().getTime();
		object.created = ts;
		object.lastModified = ts;
		object.data = req.params.object;
	
		req.env.object = object;
  	cb(0, object);
	});
}

object.destroy = function(req, res, cb)
{
	console.logl('object.destroy');
	cb(0);
}

object.get = function(req, res, cb)
{
	cb(0, req.env.object);
}

object.set = function(req, res, cb)
{
	var object = req.env.object
	var newObject = req.params.object;

	req.env.object.data = _.merge(object.data, newObject);
	var ts = new Date().getTime();
	req.env.object.lastModified = ts;
	
	cb(0, req.env.object);
}<commit_msg>add hash check to spare save if not modified;<commit_after>var _ = require('lodash');
var crypto = require('crypto');

var db = global.db;

var object = exports;

object.desc = "generic object store"
object.functions = {
	create: {desc: 'get object', params: {className:{dtype:'string'}, object:{dtype:'object'}}, security: []},
	destroy: {desc: 'get object', params: {oid:{dtype:'string'}}, security: []},
	get: {desc: 'get object', params: {className:{dtype:'string'}, oid:{dtype:'string'}}, security: []},
	set: {desc:'set object', params: {className:{dtype:'string'}, oid:{dtype:'string'}, object: {dtype: 'object'}}, security: []}
};

object.errors = {
	100: "get object failed",
	101: "set object failed",
	102: "set object failed, unable to load merge",
	103: "object already exists",
	104: "unable to save null object"
}

object.pre = function(req, res, cb)
{
	console.log('object.pre');
	var cmd = req.params.cmd;
	var className = req.params.className;
	var oid = req.params.oid;
	
	// SWD - eventually check security session.uid has rights to object
	
	req.env.object = null;
	db.kget('kObject', [className, oid], function(err, value){
		if(value == null) {
			if(cmd == 'object.create')
			{
				cb(0);  // create call and no object - ok
			} else {
				cb(100); // not create and no object - error
			}
			return;
		} else {
			if(cmd == 'object.create')
			{
				cb(103); // create and object exists - error
			} else {
				var object = JSON.parse(value);
				req.env.object = object;
				cb(0);
			}
			return;
		}
	});
}

object.post = function(req, res, cb)
{
	console.log('object.